|
@@ -8759,15 +8759,14 @@ static noinline int walk_up_proc(struct btrfs_trans_handle *trans,
|
|
|
if (eb == root->node) {
|
|
|
if (wc->flags[level] & BTRFS_BLOCK_FLAG_FULL_BACKREF)
|
|
|
parent = eb->start;
|
|
|
- else
|
|
|
- BUG_ON(root->root_key.objectid !=
|
|
|
- btrfs_header_owner(eb));
|
|
|
+ else if (root->root_key.objectid != btrfs_header_owner(eb))
|
|
|
+ goto owner_mismatch;
|
|
|
} else {
|
|
|
if (wc->flags[level + 1] & BTRFS_BLOCK_FLAG_FULL_BACKREF)
|
|
|
parent = path->nodes[level + 1]->start;
|
|
|
- else
|
|
|
- BUG_ON(root->root_key.objectid !=
|
|
|
- btrfs_header_owner(path->nodes[level + 1]));
|
|
|
+ else if (root->root_key.objectid !=
|
|
|
+ btrfs_header_owner(path->nodes[level + 1]))
|
|
|
+ goto owner_mismatch;
|
|
|
}
|
|
|
|
|
|
btrfs_free_tree_block(trans, root, eb, parent, wc->refs[level] == 1);
|
|
@@ -8775,6 +8774,11 @@ out:
|
|
|
wc->refs[level] = 0;
|
|
|
wc->flags[level] = 0;
|
|
|
return 0;
|
|
|
+
|
|
|
+owner_mismatch:
|
|
|
+ btrfs_err_rl(fs_info, "unexpected tree owner, have %llu expect %llu",
|
|
|
+ btrfs_header_owner(eb), root->root_key.objectid);
|
|
|
+ return -EUCLEAN;
|
|
|
}
|
|
|
|
|
|
static noinline int walk_down_tree(struct btrfs_trans_handle *trans,
|
|
@@ -8828,6 +8832,8 @@ static noinline int walk_up_tree(struct btrfs_trans_handle *trans,
|
|
|
ret = walk_up_proc(trans, root, path, wc);
|
|
|
if (ret > 0)
|
|
|
return 0;
|
|
|
+ if (ret < 0)
|
|
|
+ return ret;
|
|
|
|
|
|
if (path->locks[level]) {
|
|
|
btrfs_tree_unlock_rw(path->nodes[level],
|