diff options
author | 2025-07-18 18:14:40 +0100 | |
---|---|---|
committer | 2025-07-22 01:14:08 +0200 | |
commit | 55fae08a0638ac2cb362d5739f5b5eb34c758da8 (patch) | |
tree | 2d3dc9e3299daaa72c642298b948d0c5b07807da | |
parent | btrfs: use saner variable type and name to indicate extrefs at add_inode_ref() (diff) | |
download | wireguard-linux-55fae08a0638ac2cb362d5739f5b5eb34c758da8.tar.xz wireguard-linux-55fae08a0638ac2cb362d5739f5b5eb34c758da8.zip |
btrfs: unfold transaction aborts when writing dirty block groups
We have a single transaction abort call that can be due to an error from
one of two calls to update_block_group_item(). Unfold the transaction
abort calls so that if they happen we know which update_block_group_item()
call failed.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/block-group.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 47c6d040176c..9bf282d2453c 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -3644,9 +3644,11 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans) wait_event(cur_trans->writer_wait, atomic_read(&cur_trans->num_writers) == 1); ret = update_block_group_item(trans, path, cache); - } - if (ret) + if (ret) + btrfs_abort_transaction(trans, ret); + } else if (ret) { btrfs_abort_transaction(trans, ret); + } } /* If its not on the io list, we need to put the block group */ |