History

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,

Josef Bacik committed 13 years ago

Commit d8fe29e1 parent 82d130f1 file · +2 −1Browse files

Unified · Split

fs/btrfs/scrub.c+2−1
@@ -542,7 +542,6 @@ static void scrub_print_warning(const char *errstr, struct scrub_block *sblock) · 541 unmodified lines
542 eb = path->nodes[0];542 eb = path->nodes[0];
543 ei = btrfs_item_ptr(eb, path->slots[0], struct btrfs_extent_item);543 ei = btrfs_item_ptr(eb, path->slots[0], struct btrfs_extent_item);
544 item_size = btrfs_item_size_nr(eb, path->slots[0]);544 item_size = btrfs_item_size_nr(eb, path->slots[0]);
545 btrfs_release_path(path);
546 545
547 if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) {546 if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) {
548 do {547 do {
@@ -558,7 +557,9 @@ static void scrub_print_warning(const char *errstr, struct scrub_block *sblock) · 9 unmodified lines
558 ret < 0 ? -1 : ref_level,557 ret < 0 ? -1 : ref_level,
559 ret < 0 ? -1 : ref_root);558 ret < 0 ? -1 : ref_root);
560 } while (ret != 1);559 } while (ret != 1);
560 btrfs_release_path(path);
561 } else {561 } else {
562 btrfs_release_path(path);
562 swarn.path = path;563 swarn.path = path;
563 swarn.dev = dev;564 swarn.dev = dev;
564 iterate_extent_inodes(fs_info, found_key.objectid,565 iterate_extent_inodes(fs_info, found_key.objectid,