diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 38d1e7b976d800caf17c38eee629d3ecb6119689..cdbd20e62bb65fccbbc99ab26ccf2f74b80577e3 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6777,8 +6777,10 @@ bool btrfs_page_exists_in_range(struct inode *inode, loff_t start, loff_t end) break; /* TODO: Is this relevant for this use case? */ } - if (!page_cache_get_speculative(page)) + if (!page_cache_get_speculative(page)) { + page = NULL; continue; + } /* * Has the page moved?