aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@gmail.com>2014-06-05 08:22:26 -0400
committerChris Mason <clm@fb.com>2014-06-09 20:21:14 -0400
commit6fdef6d43cb897bcbbed13786e8cc8cccabc442a (patch)
treeaf3ecf8a8ffe78f736ac7257946f2174f2262664 /fs
parent809f9016253dbfec00f71e98e11c4bcbf01b6c26 (diff)
Btrfs: don't release invalid page in btrfs_page_exists_in_range()
In inode.c:btrfs_page_exists_in_range(), if the page we got from the radix tree is an exception entry, which can't be retried, we exit the loop with a non-NULL page and then call page_cache_release against it, which is not ok since it's not a valid page. 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')
-rw-r--r--fs/btrfs/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index f265f413acba..477e64a1146f 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6776,6 +6776,7 @@ bool btrfs_page_exists_in_range(struct inode *inode, loff_t start, loff_t end)
6776 * here as an exceptional entry: so return it without 6776 * here as an exceptional entry: so return it without
6777 * attempting to raise page count. 6777 * attempting to raise page count.
6778 */ 6778 */
6779 page = NULL;
6779 break; /* TODO: Is this relevant for this use case? */ 6780 break; /* TODO: Is this relevant for this use case? */
6780 } 6781 }
6781 6782