mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Darren Hart <dvhltc@us.ibm.com>
Subject: Re: [GIT pull] futex fixes for 2.6.31
Date: Thu, 25 Jun 2009 11:56:37 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0906251151400.2767@localhost.localdomain> (raw)
In-Reply-To: <1245897826.2560.421.camel@ymzhang>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 965 bytes --]

On Thu, 25 Jun 2009, Zhang, Yanmin wrote:
> On Wed, 2009-06-24 at 21:48 +0200, Thomas Gleixner wrote:
> > +static int fault_in_user_writeable(u32 __user *uaddr)
> > +{
> > +	int ret = get_user_pages(current, current->mm, (unsigned long)uaddr,
> > +				 sizeof(*uaddr), 1, 0, NULL, NULL);
> The 4th parameter of get_user_pages means page number. sizeof(*uaddr) is equal to
> 4, so you want 4 pages?

Grrr. I looked up the prototype of it in include/linux/mm.h:

int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
			unsigned long start, int len, int write, int force,
			struct page **pages, struct vm_area_struct **vmas);

len == number of pages ! How intutitive. :(

I guess Linus tripped over it as well. See:
http://lkml.org/lkml/2009/6/21/95

> > > In fact, since you're not actually interested in the page, you _could_ 
> > > just do
> > >
> > >  get_user_pages(tsk, mm, uaddr, 4, 1, 0, NULL, NULL);

Will fix, thanks for noticing!

     tglx

  reply	other threads:[~2009-06-25  9:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-24 14:36 [PATCH V2] futex: Fix the write access fault problem for real Thomas Gleixner
2009-06-24 16:46 ` Linus Torvalds
2009-06-24 19:48   ` [GIT pull] futex fixes for 2.6.31 Thomas Gleixner
2009-06-25  2:43     ` Zhang, Yanmin
2009-06-25  9:56       ` Thomas Gleixner [this message]
2009-06-25 10:04         ` Ingo Molnar
2009-06-25 18:15           ` [GIT pull] final " Thomas Gleixner
2009-06-25 18:26             ` Linus Torvalds
2009-06-25  9:58       ` [PATCH] clarify get_user_pages() prototype Peter Zijlstra

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=alpine.LFD.2.00.0906251151400.2767@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=dvhltc@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    --cc=yanmin_zhang@linux.intel.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

all inboxes | Powered by JetHome®