diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2020-05-19 14:50:37 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-01 11:11:55 +0200 |
commit | 1cec5992cc34aa082541ff10b0ba0356e1e3c045 (patch) | |
tree | a7afb9570cd5004de1d9e8ea1121fd095673c6d4 | |
parent | 529a069e823afe037a661db459690c91d853175c (diff) |
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>
-rw-r--r-- | fs/fuse/dev.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 8142f6bf3d31..fc265f4b839a 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -850,7 +850,6 @@ static int fuse_check_page(struct page *page) { if (page_mapcount(page) || page->mapping != NULL || - page_count(page) != 1 || (page->flags & PAGE_FLAGS_CHECK_AT_PREP & ~(1 << PG_locked | 1 << PG_referenced | |