Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755840Ab2JPFK4 (ORCPT ); Tue, 16 Oct 2012 01:10:56 -0400 Received: from mail-oa0-f46.google.com ([209.85.219.46]:61342 "EHLO mail-oa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755652Ab2JPFKz (ORCPT ); Tue, 16 Oct 2012 01:10:55 -0400 MIME-Version: 1.0 In-Reply-To: References: <20121008150949.GA15130@redhat.com> From: KOSAKI Motohiro Date: Tue, 16 Oct 2012 01:10:34 -0400 Message-ID: Subject: Re: mpol_to_str revisited. To: David Rientjes Cc: Dave Jones , Linux Kernel , bhutchings@solarflare.com, linux-mm@kvack.org, Linus Torvalds , Andrew Morton Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1215 Lines: 27 On Mon, Oct 15, 2012 at 11:58 PM, David Rientjes wrote: > On Mon, 15 Oct 2012, KOSAKI Motohiro wrote: > >> I don't think 80de7c3138ee9fd86a98696fd2cf7ad89b995d0a is right fix. > > It's certainly not a complete fix, but I think it's a much better result > of the race, i.e. we don't panic anymore, we simply fail the read() > instead. Even though 80de7c3138ee9fd86a98696fd2cf7ad89b995d0a itself is simple. It bring to caller complex. That's not good and have no worth. >> we should >> close a race (or kill remain ref count leak) if we still have. > > As I mentioned earlier in the thread, the read() is done here on a task > while only a reference to the task_struct is taken and we do not hold > task_lock() which is required for task->mempolicy. Once that is fixed, > mpol_to_str() should never be called for !task->mempolicy so it will never > need to return -EINVAL in such a condition. I agree that's obviously a bug and we should fix it. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/