aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@gmail.com>2014-06-05 08:22:25 -0400
committerChris Mason <clm@fb.com>2014-06-09 20:21:13 -0400
commit809f9016253dbfec00f71e98e11c4bcbf01b6c26 (patch)
tree9de246dd948d1de525d70d290118a28bb64b4c9d
parent91405151eb7005949072bee751343390757f8417 (diff)
Btrfs: make sure we retry if page is a retriable exception
In inode.c:btrfs_page_exists_in_range(), if the page we get from the radix tree is an exception which should make us retry, set page to NULL in order to really retry, because otherwise we don't get another loop iteration executed (page != NULL makes the while loop exit). This also was making us call page_cache_release after exiting the loop, which isn't correct because page doesn't point to a valid page, and possibly return true from the function when we shouldn't. Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Signed-off-by: Chris Mason <clm@fb.com>
-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 cdbd20e62bb6..f265f413acba 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6767,8 +6767,10 @@ bool btrfs_page_exists_in_range(struct inode *inode, loff_t start, loff_t end)
6767 break; 6767 break;
6768 6768
6769 if (radix_tree_exception(page)) { 6769 if (radix_tree_exception(page)) {
6770 if (radix_tree_deref_retry(page)) 6770 if (radix_tree_deref_retry(page)) {
6771 page = NULL;
6771 continue; 6772 continue;
6773 }
6772 /* 6774 /*
6773 * Otherwise, shmem/tmpfs must be storing a swap entry 6775 * Otherwise, shmem/tmpfs must be storing a swap entry
6774 * here as an exceptional entry: so return it without 6776 * here as an exceptional entry: so return it without