aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@gmail.com>2014-06-05 08:22:24 -0400
committerChris Mason <clm@fb.com>2014-06-09 20:21:12 -0400
commit91405151eb7005949072bee751343390757f8417 (patch)
tree09a10ab7a754d092e46bff6cd46d41847de439a4 /fs/btrfs
parentc81d57679ee4b87a5b50e9afe4e5d1866d08b9ad (diff)
Btrfs: make sure we retry if we couldn't get the page
In inode.c:btrfs_page_exists_in_range(), if we can't get the page we need to retry. However we weren't retrying because we weren't setting page to NULL, which makes the while loop exit immediately and will make us call page_cache_release after exiting the loop which is incorrect because our page get didn't succeed. This could also make us return true when we shouldn't. Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/inode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 38d1e7b976d8..cdbd20e62bb6 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)
6777 break; /* TODO: Is this relevant for this use case? */ 6777 break; /* TODO: Is this relevant for this use case? */
6778 } 6778 }
6779 6779
6780 if (!page_cache_get_speculative(page)) 6780 if (!page_cache_get_speculative(page)) {
6781 page = NULL;
6781 continue; 6782 continue;
6783 }
6782 6784
6783 /* 6785 /*
6784 * Has the page moved? 6786 * Has the page moved?