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 18:40:13 +0000 (20:40 +0200)
commit3a9677b791bb866bef538ebeb8d77d76adac536d
tree3a1c4dc804b46027228996f946fd8a51d78c2d4b
parent70109a8b5f8a57ac84b9c295187abecc30a2dc33
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