Skip to content

Commit 6cbfbf3

Browse files
fdmananakdave
authored andcommitted
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 <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 2ea8921 commit 6cbfbf3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/btrfs/block-group.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3644,9 +3644,11 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans)
36443644
wait_event(cur_trans->writer_wait,
36453645
atomic_read(&cur_trans->num_writers) == 1);
36463646
ret = update_block_group_item(trans, path, cache);
3647-
}
3648-
if (ret)
3647+
if (ret)
3648+
btrfs_abort_transaction(trans, ret);
3649+
} else if (ret) {
36493650
btrfs_abort_transaction(trans, ret);
3651+
}
36503652
}
36513653

36523654
/* If its not on the io list, we need to put the block group */

0 commit comments

Comments
 (0)