Commit d2f79e63 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba

btrfs: remove redundant BUG_ON() from __btrfs_inc_extent_ref()

At __btrfs_inc_extent_ref() we are doing a BUG_ON() if we are dealing with
a tree block reference that has a reference count that is different from 1,
but we have already dealt with this case at run_delayed_tree_ref(), making
it useless. So remove the BUG_ON().
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 1bf76df3
...@@ -1514,15 +1514,14 @@ static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans, ...@@ -1514,15 +1514,14 @@ static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
btrfs_release_path(path); btrfs_release_path(path);
/* now insert the actual backref */ /* now insert the actual backref */
if (owner < BTRFS_FIRST_FREE_OBJECTID) { if (owner < BTRFS_FIRST_FREE_OBJECTID)
BUG_ON(refs_to_add != 1);
ret = insert_tree_block_ref(trans, path, bytenr, parent, ret = insert_tree_block_ref(trans, path, bytenr, parent,
root_objectid); root_objectid);
} else { else
ret = insert_extent_data_ref(trans, path, bytenr, parent, ret = insert_extent_data_ref(trans, path, bytenr, parent,
root_objectid, owner, offset, root_objectid, owner, offset,
refs_to_add); refs_to_add);
}
if (ret) if (ret)
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
out: out:
......
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