OSDN Git Service

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>
Mon, 21 Mar 2022 16:56:34 +0000 (12:56 -0400)
commit8ea2979c1444cd455ddbe7f976de79cc09fdc38d
tree984f8232835647aab7eb9501927174c03fd2c72c
parentd90a25f86dc83df9ce7f1446372cda8029e87f7c
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