linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: kosaki.motohiro@jp.fujitsu.com,
	Andrew Morton <akpm@linux-foundation.org>,
	Americo Wang <xiyou.wangcong@gmail.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Arjan van de Ven <arjan@infradead.org>,
	Roland Dreier <rdreier@cisco.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH] memdup_user: introduce, fix
Date: Tue, 10 Mar 2009 10:53:35 +0900 (JST)	[thread overview]
Message-ID: <20090310105258.A483.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <49B5C69F.3010409@cn.fujitsu.com>

>   * Include machine specific inline routines
> diff --git a/mm/util.c b/mm/util.c
> index 3d21c21..7c122e4 100644
> --- a/mm/util.c
> +++ b/mm/util.c
> @@ -74,15 +74,19 @@ EXPORT_SYMBOL(kmemdup);
>   *
>   * @src: source address in user space
>   * @len: number of bytes to copy
> - * @gfp: GFP mask to use
>   *
>   * Returns an ERR_PTR() on failure.
>   */
> -void *memdup_user(const void __user *src, size_t len, gfp_t gfp)
> +void *memdup_user(const void __user *src, size_t len)
>  {
>  	void *p;
>  
> -	p = kmalloc_track_caller(len, gfp);
> +	/*
> +	 * Always use GFP_KERNEL, since copy_from_user() can sleep and
> +	 * cause pagefault, which makes it pointless to use GFP_NOFS
> +	 * or GFP_ATOMIC.
> +	 */
> +	p = kmalloc_track_caller(len, GFP_KERNEL);
>  	if (!p)
>  		return ERR_PTR(-ENOMEM);

ok. thanks.
	Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>



--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2009-03-10  1:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-10  1:47 Li Zefan
2009-03-10  1:53 ` KOSAKI Motohiro [this message]

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=20090310105258.A483.A69D9226@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=rdreier@cisco.com \
    --cc=xiyou.wangcong@gmail.com \
    /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