linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Kautuk Consul <consul.kautuk@gmail.com>
Cc: Hugh Dickins <hughd@google.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] mmap.c: find_vma: remove if(mm) check
Date: Tue, 27 Mar 2012 15:12:38 -0700	[thread overview]
Message-ID: <20120327151238.302a5920.akpm@linux-foundation.org> (raw)
In-Reply-To: <1332805767-2013-1-git-send-email-consul.kautuk@gmail.com>

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;

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>

  reply	other threads:[~2012-03-27 22:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26 23:49 Kautuk Consul
2012-03-27 22:12 ` Andrew Morton [this message]
2012-03-28  3:43   ` Kautuk Consul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120327151238.302a5920.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=consul.kautuk@gmail.com \
    --cc=hughd@google.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox