linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Suren Baghdasaryan <surenb@google.com>
To: Lokesh Gidra <lokeshgidra@google.com>
Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
	 linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	selinux@vger.kernel.org,  kernel-team@android.com,
	aarcange@redhat.com, peterx@redhat.com,  david@redhat.com,
	axelrasmussen@google.com, bgeffon@google.com,
	 willy@infradead.org, jannh@google.com, kaleshsingh@google.com,
	 ngeoffray@google.com
Subject: Re: [PATCH] userfaultfd: fix return error if mmap_changing is non-zero in MOVE ioctl
Date: Wed, 17 Jan 2024 14:46:22 -0800	[thread overview]
Message-ID: <CAJuCfpHFNBSteck_bWxHwXDzeqC7QLn6hks5PoMC4ytWbJO4tQ@mail.gmail.com> (raw)
In-Reply-To: <20240117223922.1445327-1-lokeshgidra@google.com>

On Wed, Jan 17, 2024 at 2:39 PM Lokesh Gidra <lokeshgidra@google.com> wrote:
>
> To be consistent with other uffd ioctl's returning EAGAIN when
> mmap_changing is detected, we should change UFFDIO_MOVE to do the same.
>
> Signed-off-by: Lokesh Gidra <lokeshgidra@google.com>

Looks correct. Thanks for catching it!

Acked-by: Suren Baghdasaryan <surenb@google.com>

> ---
>  fs/userfaultfd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
> index 959551ff9a95..05c8e8a05427 100644
> --- a/fs/userfaultfd.c
> +++ b/fs/userfaultfd.c
> @@ -2047,7 +2047,7 @@ static int userfaultfd_move(struct userfaultfd_ctx *ctx,
>                         ret = move_pages(ctx, mm, uffdio_move.dst, uffdio_move.src,
>                                          uffdio_move.len, uffdio_move.mode);
>                 else
> -                       ret = -EINVAL;
> +                       ret = -EAGAIN;
>
>                 mmap_read_unlock(mm);
>                 mmput(mm);
> --
> 2.43.0.429.g432eaa2c6b-goog
>


  reply	other threads:[~2024-01-17 22:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 22:39 Lokesh Gidra
2024-01-17 22:46 ` Suren Baghdasaryan [this message]
2024-01-25  9:37 ` Mike Rapoport

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=CAJuCfpHFNBSteck_bWxHwXDzeqC7QLn6hks5PoMC4ytWbJO4tQ@mail.gmail.com \
    --to=surenb@google.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=bgeffon@google.com \
    --cc=david@redhat.com \
    --cc=jannh@google.com \
    --cc=kaleshsingh@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lokeshgidra@google.com \
    --cc=ngeoffray@google.com \
    --cc=peterx@redhat.com \
    --cc=selinux@vger.kernel.org \
    --cc=willy@infradead.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