From: Filipe Manana Date: Thu, 5 Jun 2014 12:22:25 +0000 (+0100) Subject: Btrfs: make sure we retry if page is a retriable exception X-Git-Tag: firefly_0821_release~176^2~3585^2~50 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=809f9016253dbfec00f71e98e11c4bcbf01b6c26;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Chris Mason --- 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) break; if (radix_tree_exception(page)) { - if (radix_tree_deref_retry(page)) + if (radix_tree_deref_retry(page)) { + page = NULL; continue; + } /* * Otherwise, shmem/tmpfs must be storing a swap entry * here as an exceptional entry: so return it without