aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJosef Bacik2013-03-29 09:09:34 -0500
committerGreg Kroah-Hartman2013-04-05 11:26:02 -0500
commit795dae3bdf2ecd7d325264e5527c76a647590f43 (patch)
treefd598ea5f38006a561d20f9d75549a5f592f4d87 /fs
parent3df6391ba957b799fa30cb558d924aee647ccd34 (diff)
downloadkernel-omap-795dae3bdf2ecd7d325264e5527c76a647590f43.tar.gz
kernel-omap-795dae3bdf2ecd7d325264e5527c76a647590f43.tar.xz
kernel-omap-795dae3bdf2ecd7d325264e5527c76a647590f43.zip
Btrfs: don't drop path when printing out tree errors in scrub
commit d8fe29e9dea8d7d61fd140d8779326856478fc62 upstream. 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, Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-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 67783e03d121..48761b671f06 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -541,7 +541,6 @@ static void scrub_print_warning(const char *errstr, struct scrub_block *sblock)
541 eb = path->nodes[0]; 541 eb = path->nodes[0];
542 ei = btrfs_item_ptr(eb, path->slots[0], struct btrfs_extent_item); 542 ei = btrfs_item_ptr(eb, path->slots[0], struct btrfs_extent_item);
543 item_size = btrfs_item_size_nr(eb, path->slots[0]); 543 item_size = btrfs_item_size_nr(eb, path->slots[0]);
544 btrfs_release_path(path);
545 544
546 if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) { 545 if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) {
547 do { 546 do {
@@ -557,7 +556,9 @@ static void scrub_print_warning(const char *errstr, struct scrub_block *sblock)
557 ret < 0 ? -1 : ref_level, 556 ret < 0 ? -1 : ref_level,
558 ret < 0 ? -1 : ref_root); 557 ret < 0 ? -1 : ref_root);
559 } while (ret != 1); 558 } while (ret != 1);
559 btrfs_release_path(path);
560 } else { 560 } else {
561 btrfs_release_path(path);
561 swarn.path = path; 562 swarn.path = path;
562 swarn.dev = dev; 563 swarn.dev = dev;
563 iterate_extent_inodes(fs_info, found_key.objectid, 564 iterate_extent_inodes(fs_info, found_key.objectid,