[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFyH63agfbf+pYNRGHaprPqAJF=F19GR6ASP_RhoyDGLdA@mail.gmail.com>
Date: Wed, 2 Jan 2013 09:24:37 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Christoph Lameter <cl@...ux.com>
Cc: Hugh Dickins <hughd@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Lee Schermerhorn <lee.schermerhorn@...com>,
KOSAKI Motohiro <kosaki.motohiro@...il.com>,
David Rientjes <rientjes@...gle.com>,
Mel Gorman <mgorman@...e.de>, Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>
Subject: Re: [PATCH 1/2] tmpfs mempolicy: fix /proc/mounts corrupting memory
On Wed, Jan 2, 2013 at 7:57 AM, Christoph Lameter <cl@...ux.com> wrote:
> On Wed, 2 Jan 2013, Hugh Dickins wrote:
>
>> @@ -2796,10 +2787,7 @@ int mpol_to_str(char *buffer, int maxlen
>> case MPOL_BIND:
>> /* Fall through */
>> case MPOL_INTERLEAVE:
>> - if (no_context)
>> - nodes = pol->w.user_nodemask;
>> - else
>> - nodes = pol->v.nodes;
>> + nodes = pol->v.nodes;
>> break;
>>
>
> no_context was always true. Why is the code from the false branch kept?
no_context is zero in the caller in fs/proc/task_mmu.c, and one in the
mm/shmem.c caller. So it's not always true (for mpol_parse_str() there
is only one caller, and it's always true as Hugh said).
Anyway, I do not know why Hugh took the true case, but I don't really
imagine that it matters. So I'll take these two patches, but it would
be good if you double-checked this, Hugh.
Hugh?
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists