aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/scrub.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-03-29 08:09:34 -0600
committerChris Mason <chris.mason@fusionio.com>2013-03-29 10:18:59 -0400
commitd8fe29e9dea8d7d61fd140d8779326856478fc62 (patch)
treefb5867b3c130d23305a2fec87eed49708d5e7cdc /fs/btrfs/scrub.c
parent82d130ff390be67d980d8b6f39e921c0b1d8d8e0 (diff)
downloadkernel_goldelico_gta04-d8fe29e9dea8d7d61fd140d8779326856478fc62.zip
kernel_goldelico_gta04-d8fe29e9dea8d7d61fd140d8779326856478fc62.tar.gz
kernel_goldelico_gta04-d8fe29e9dea8d7d61fd140d8779326856478fc62.tar.bz2
Btrfs: don't drop path when printing out tree errors in scrub
A user reported a panic where we were panicing somewhere in tree_backref_for_extent from scrub_print_warning. He only captured the trace but looking at scrub_print_warning we drop the path right before we mess with the extent buffer to print out a bunch of stuff, which isn't right. So fix this by dropping the path after we use the eb if we need to. Thanks, Cc: stable@vger.kernel.org Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r--fs/btrfs/scrub.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 53c3501..85e072b 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -542,7 +542,6 @@ static void scrub_print_warning(const char *errstr, struct scrub_block *sblock)
eb = path->nodes[0];
ei = btrfs_item_ptr(eb, path->slots[0], struct btrfs_extent_item);
item_size = btrfs_item_size_nr(eb, path->slots[0]);
- btrfs_release_path(path);
if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) {
do {
@@ -558,7 +557,9 @@ static void scrub_print_warning(const char *errstr, struct scrub_block *sblock)
ret < 0 ? -1 : ref_level,
ret < 0 ? -1 : ref_root);
} while (ret != 1);
+ btrfs_release_path(path);
} else {
+ btrfs_release_path(path);
swarn.path = path;
swarn.dev = dev;
iterate_extent_inodes(fs_info, found_key.objectid,