Re: [PATCH 1/1] userfaultfd: remove WRITE_ONCE when setting folio->index during UFFDIO_MOVE

Peter Xu
2024-04-15T13:31:34Z

On Sun, Apr 14, 2024 at 07:08:21PM -0700, Suren Baghdasaryan wrote:
> When folio is moved with UFFDIO_MOVE it gets locked before the rmap and
> index are modified. Due to the folio lock being already held, WRITE_ONCE()
> is not needed when setting the folio index. Remove it.
>
> Reported-by: Matthew Wilcox <willy@infradead.org>
> Signed-off-by: Suren Baghdasaryan <surenb@google.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: Lokesh Gidra <lokeshgidra@google.com>

Reviewed-by: Peter Xu <peterx@redhat.com>

--
Peter Xu