linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
To: Marco Stornelli <marco.stornelli@gmail.com>
Cc: Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	Mike Snitzer <snitzer@redhat.com>,
	Alasdair G Kergon <agk@redhat.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>, Jan Kara <jack@suse.cz>
Subject: Re: [PATCH 4/4] fsfreeze: avoid to return zero in __get_user_pages
Date: Sat, 6 Apr 2013 13:36:56 -0400	[thread overview]
Message-ID: <CAHGf_=p=U8urX0NF4M0=brffLhvWYU-6kcA2+sBWa8f1JFGkzw@mail.gmail.com> (raw)
In-Reply-To: <515FF3CC.80106@gmail.com>

On Sat, Apr 6, 2013 at 6:07 AM, Marco Stornelli
<marco.stornelli@gmail.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@gmail.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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2013-04-06 17:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-06 10:07 Marco Stornelli
2013-04-06 17:36 ` KOSAKI Motohiro [this message]

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='CAHGf_=p=U8urX0NF4M0=brffLhvWYU-6kcA2+sBWa8f1JFGkzw@mail.gmail.com' \
    --to=kosaki.motohiro@gmail.com \
    --cc=agk@redhat.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=marco.stornelli@gmail.com \
    --cc=snitzer@redhat.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