mm/gup: Increment the page refcount before the pincount
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 4 Feb 2022 14:24:26 +0000 (09:24 -0500)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 17 Feb 2022 22:05:51 +0000 (17:05 -0500)
commit2e48fbe80625ec17bdb60eae51742b9f6f571664
tree3f3841948e1083a743b0884f97b8093402b9b69d
parent0c09b7dd3a2eef6779c002758c00448999919b1c
mm/gup: Increment the page refcount before the pincount

We should always increase the refcount before doing anything else to
the page so that other page users see the elevated refcount first.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
mm/gup.c