[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHGf_=p=U8urX0NF4M0=brffLhvWYU-6kcA2+sBWa8f1JFGkzw@mail.gmail.com>
Date: Sat, 6 Apr 2013 13:36:56 -0400
From: KOSAKI Motohiro <kosaki.motohiro@...il.com>
To: Marco Stornelli <marco.stornelli@...il.com>
Cc: Linux FS Devel <linux-fsdevel@...r.kernel.org>,
Mike Snitzer <snitzer@...hat.com>,
Alasdair G Kergon <agk@...hat.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>, Jan Kara <jack@...e.cz>
Subject: Re: [PATCH 4/4] fsfreeze: avoid to return zero in __get_user_pages
On Sat, Apr 6, 2013 at 6:07 AM, Marco Stornelli
<marco.stornelli@...il.com> wrote:
> In case of VM_FAULT_RETRY, __get_user_pages returns the number
> of pages alredy gotten, but there isn't a check if this number is
> zero. Instead, we have to return a proper error code so we can avoid
> a possible extra call of __get_user_pages. There are several
> places where get_user_pages is called inside a loop until all the
> pages requested are gotten or an error code is returned.
>
> Signed-off-by: Marco Stornelli <marco.stornelli@...il.com>
> ---
> mm/memory.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index 494526a..cca14ed 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1858,7 +1858,7 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
> if (ret & VM_FAULT_RETRY) {
> if (nonblocking)
> *nonblocking = 0;
> - return i;
> + return i ? i : -ERESTARTSYS;
nonblock argument is only used from __mm_populate() and it expect
__get_user_pages() return 0.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists