lkml.org 
[lkml]   [2012]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/1] mmap.c: find_vma: remove if(mm) check
From
On Wed, Mar 28, 2012 at 3:42 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Mon, 26 Mar 2012 19:49:27 -0400
> Kautuk Consul <consul.kautuk@gmail.com> wrote:
>
>> find_vma is called from kernel code where it is absolutely
>> sure that the mm_struct arg being passed to it is non-NULL.
>>
>> Remove the if(mm) check.
>
> It's odd that the if(mm) test exists - I wonder why it was originally
> added.  My repo only goes back ten years, and it's there in 2.4.18.
>
> Any code which calls find_vma() without an mm is surely pretty busted?
>
>
> Still, I think I'd prefer to do
>
>        if (WARN_ON_ONCE(!mm))
>                return NULL;
>

yes, I agree. that is safe for now as there are a huge number of calls
to this API.

> then let that bake for a kernel release, just to find out if we have a
> weird caller out there, such as a function which is called by both user
> threads and by kernel threads.

ok. I'll spin another one and send it to you with your suggestions in a day or
two when I go back home after my day job.
--
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/

\
 
 \ /
  Last update: 2012-03-28 05:45    [W:1.618 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site