Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

btrfs: don't call btrfs_handle_fs_error() in btrfs_commit_transaction()

There's no need to call btrfs_handle_fs_error() as we are inside a
transaction and if we get an error we jump to the 'scrub_continue' label
and end up calling cleanup_transaction(), which aborts the transaction.

This is odd given that we have a transaction handle and that in the
transaction commit path any error makes us abort the transaction and
it's the only place that calls btrfs_handle_fs_error().

Remove the btrfs_handle_fs_error() call and replace it with an error
message so that if it happens we know what went wrong during the
transaction commit. Also annotate the condition in the if statement
with 'unlikely' since this is not expected to happen.

We've been wanting to remove btrfs_handle_fs_error(), so this removes
one user that does not even needs it.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Filipe Manana and committed by
David Sterba
68d4ece9 d15a190d

+2 -3
+2 -3
fs/btrfs/transaction.c
··· 2550 2550 wake_up_process(fs_info->cleaner_kthread); 2551 2551 2552 2552 ret = btrfs_write_and_wait_transaction(trans); 2553 - if (ret) { 2554 - btrfs_handle_fs_error(fs_info, ret, 2555 - "Error while writing out transaction"); 2553 + if (unlikely(ret)) { 2554 + btrfs_err(fs_info, "error while writing out transaction: %d", ret); 2556 2555 mutex_unlock(&fs_info->tree_log_mutex); 2557 2556 goto scrub_continue; 2558 2557 }