Thread (3 messages) 3 messages, 2 authors, 2012-03-28

Re: [PATCH 1/1] mmap.c: find_vma: remove if(mm) check

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2012-03-27 22:12:41
Also in: lkml

On Mon, 26 Mar 2012 19:49:27 -0400
Kautuk Consul [off-list ref] 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;

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.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help