[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c384c5ea0908040420v431fd075hd053f36c232d5966@mail.gmail.com>
Date: Tue, 4 Aug 2009 13:20:50 +0200
From: Leon Woestenberg <leon.woestenberg@...il.com>
To: Brice Goglin <Brice.Goglin@...ia.fr>
Cc: Hugh Dickins <hugh.dickins@...cali.co.uk>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: get_user_pages() stores ERR_PTR() in pages[i] on
failure
Hello Brice,
On Tue, Aug 4, 2009 at 12:39 PM, Brice Goglin<Brice.Goglin@...ia.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)-block
should also have brackets (even when it's a one-liner on the else
block).
Looks good, I will go ahead and test it (back-port/patched against 2.6.30).
Regards,
--
Leon
Powered by blists - more mailing lists