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
542542 eb = path->nodes[0];
543543 ei = btrfs_item_ptr(eb, path->slots[0], struct btrfs_extent_item);
544544 item_size = btrfs_item_size_nr(eb, path->slots[0]);
545− btrfs_release_path(path);
546545
547546 if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) {
548547 do {
@@ -558,7 +557,9 @@ static void scrub_print_warning(const char *errstr, struct scrub_block *sblock) · 9 unmodified lines
558557 ret < 0 ? -1 : ref_level,
559558 ret < 0 ? -1 : ref_root);
560559 } while (ret != 1);
560+ btrfs_release_path(path);
561561 } else {
562+ btrfs_release_path(path);
562563 swarn.path = path;
563564 swarn.dev = dev;
564565 iterate_extent_inodes(fs_info, found_key.objectid,