fuse: don't check refcount after stealing page
authorMiklos Szeredi <mszeredi@redhat.com>
Tue, 19 May 2020 12:50:37 +0000 (14:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 11:12:44 +0000 (13:12 +0200)
commitfc8f9b9fd1dfe1f8d04967ee751806c56cce6310
treef70b7016a3b1159fc258f8589e336147d95d4992
parentac9867f43981c652fadd662e93b529718d1ab1e5
fuse: don't check refcount after stealing page

[ Upstream commit 32f98877c57bee6bc27f443a96f49678a2cd6a50 ]

page_count() is unstable.  Unless there has been an RCU grace period
between when the page was removed from the page cache and now, a
speculative reference may exist from the page cache.

Reported-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/fuse/dev.c