Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755699AbZFYKEf (ORCPT ); Thu, 25 Jun 2009 06:04:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752887AbZFYKE1 (ORCPT ); Thu, 25 Jun 2009 06:04:27 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:56628 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752335AbZFYKE1 (ORCPT ); Thu, 25 Jun 2009 06:04:27 -0400 Date: Thu, 25 Jun 2009 12:04:13 +0200 From: Ingo Molnar To: Thomas Gleixner Cc: "Zhang, Yanmin" , Linus Torvalds , LKML , Peter Zijlstra , Darren Hart Subject: Re: [GIT pull] futex fixes for 2.6.31 Message-ID: <20090625100413.GD29980@elte.hu> References: <1245897826.2560.421.camel@ymzhang> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.5 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1174 Lines: 32 * Thomas Gleixner wrote: > 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 heh, and then i suggested to you to change the '4' to sizeof(u32) ;-) Ingo -- 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/