mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 08:51:46 -04:00
btrfs: unfold transaction abort at __btrfs_inc_extent_ref()
Instead of having a common btrfs_abort_transaction() call for when either insert_tree_block_ref() failed or when insert_extent_data_ref() failed, move the btrfs_abort_transaction() to happen immediately after each one of those calls, so that when analysing a stack trace with a transaction abort we know which call failed. Reviewed-by: Boris Burkov <boris@bur.io> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
committed by
David Sterba
parent
3f757b56f1
commit
227aa55fa2
@@ -1522,13 +1522,15 @@ static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
|
||||
btrfs_release_path(path);
|
||||
|
||||
/* now insert the actual backref */
|
||||
if (owner < BTRFS_FIRST_FREE_OBJECTID)
|
||||
if (owner < BTRFS_FIRST_FREE_OBJECTID) {
|
||||
ret = insert_tree_block_ref(trans, path, node, bytenr);
|
||||
else
|
||||
if (ret)
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
} else {
|
||||
ret = insert_extent_data_ref(trans, path, node, bytenr);
|
||||
|
||||
if (ret)
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
if (ret)
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user