From: Leon Woestenberg <leon.woestenberg@gmail.com>
To: Brice Goglin <Brice.Goglin@inria.fr>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: get_user_pages() stores ERR_PTR() in pages[i] on failure
Date: Tue, 4 Aug 2009 13:20:50 +0200 [thread overview]
Message-ID: <c384c5ea0908040420v431fd075hd053f36c232d5966@mail.gmail.com> (raw)
In-Reply-To: <4A780FE6.9050704@inria.fr>
Hello Brice,
On Tue, Aug 4, 2009 at 12:39 PM, Brice Goglin<Brice.Goglin@inria.fr> wrote:>> Only compile-tested (and not in the nommu case).>> @@ -1317,10 +1320,11 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,> FAULT_FLAG_WRITE : 0);>> if (ret & VM_FAULT_ERROR) {> - if (ret & VM_FAULT_OOM)> - return i ? i : -ENOMEM;> - else if (ret & VM_FAULT_SIGBUS)> - return i ? i : -EFAULT;> + if (ret & VM_FAULT_OOM) {> + err = -ENOMEM;> + goto abort;> + } else if (ret & VM_FAULT_SIGBUS)> + goto abort;
Minor style issue; when the if-block has brackets, the else(if)-blockshould also have brackets (even when it's a one-liner on the elseblock).
Looks good, I will go ahead and test it (back-port/patched against 2.6.30).
Regards,-- Leonÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next prev parent reply other threads:[~2009-08-04 11:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-03 15:23 get_user_pages() on an mmap()ed file allowed? What to do if 0 < get_user_pages(..., nr_pages, ...) < nr_pages? Leon Woestenberg
2009-08-03 16:30 ` Hugh Dickins
2009-08-04 8:57 ` Leon Woestenberg
2009-08-04 9:50 ` KAMEZAWA Hiroyuki
2009-08-04 10:07 ` Leon Woestenberg
2009-08-04 9:18 ` Brice Goglin
2009-08-04 9:59 ` Leon Woestenberg
2009-08-04 10:39 ` [PATCH] mm: get_user_pages() stores ERR_PTR() in pages[i] on failure Brice Goglin
2009-08-04 11:20 ` Leon Woestenberg [this message]
2009-08-04 12:00 ` Hugh Dickins
2009-08-04 16:25 ` Leon Woestenberg
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=c384c5ea0908040420v431fd075hd053f36c232d5966@mail.gmail.com \
--to=leon.woestenberg@gmail.com \
--cc=Brice.Goglin@inria.fr \
--cc=hugh.dickins@tiscali.co.uk \
--cc=linux-kernel@vger.kernel.org \
/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