Commit 5eb178f3 authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

btrfs: handle errors from btrfs_dec_ref() properly

In walk_up_proc() we BUG_ON(ret) from btrfs_dec_ref().  This is
incorrect, we have proper error handling here, return the error.
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent f9c5b70c
...@@ -5802,7 +5802,10 @@ static noinline int walk_up_proc(struct btrfs_trans_handle *trans, ...@@ -5802,7 +5802,10 @@ static noinline int walk_up_proc(struct btrfs_trans_handle *trans,
ret = btrfs_dec_ref(trans, root, eb, 1); ret = btrfs_dec_ref(trans, root, eb, 1);
else else
ret = btrfs_dec_ref(trans, root, eb, 0); ret = btrfs_dec_ref(trans, root, eb, 0);
BUG_ON(ret); /* -ENOMEM */ if (ret) {
btrfs_abort_transaction(trans, ret);
return ret;
}
if (is_fstree(btrfs_root_id(root))) { if (is_fstree(btrfs_root_id(root))) {
ret = btrfs_qgroup_trace_leaf_items(trans, eb); ret = btrfs_qgroup_trace_leaf_items(trans, eb);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment