Skip to content

Commit 4db8d56

Browse files
fdmananakdave
authored andcommitted
btrfs: remove btrfs_handle_fs_error() after failure to recover log trees
There is no need to call btrfs_handle_fs_error() (which we are trying to deprecate) if we fail to recover log trees: 1) Such a failure results in failing the mount immediately; 2) If the recovery started a transaction before failing, it has already aborted the transaction down in the call chain. So remove the btrfs_handle_fs_error() call, replace it with an error message and assert that the FS is in error state (so that no partial updates are committed due to a transaction that was not aborted). Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 64def7d commit 4db8d56

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

fs/btrfs/disk-io.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,9 +2023,9 @@ static int btrfs_replay_log(struct btrfs_fs_info *fs_info,
20232023
/* returns with log_tree_root freed on success */
20242024
ret = btrfs_recover_log_trees(log_tree_root);
20252025
btrfs_put_root(log_tree_root);
2026-
if (ret) {
2027-
btrfs_handle_fs_error(fs_info, ret,
2028-
"Failed to recover log tree");
2026+
if (unlikely(ret)) {
2027+
ASSERT(BTRFS_FS_ERROR(fs_info) != 0);
2028+
btrfs_err(fs_info, "failed to recover log trees with error: %d", ret);
20292029
return ret;
20302030
}
20312031

0 commit comments

Comments
 (0)