Commit 8bc61290 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba
Browse files

btrfs: don't call btrfs_handle_fs_error() after failure to join transaction



In btrfs_find_orphan_roots() we don't need to call btrfs_handle_fs_error()
if we fail to join a transaction. This is because we haven't done anything
yet regarding the current root and previous iterations of the loop dealt
with other roots, so there's nothing we need to undo. Instead log an error
message and return the error to the caller, which will result either in
a mount failure or remount failure (the only contexts it's called from).

Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 19231903
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -264,8 +264,9 @@ int btrfs_find_orphan_roots(struct btrfs_fs_info *fs_info)
			trans = btrfs_join_transaction(tree_root);
			if (IS_ERR(trans)) {
				ret = PTR_ERR(trans);
				btrfs_handle_fs_error(fs_info, ret,
					    "Failed to start trans to delete orphan item");
				btrfs_err(fs_info,
			  "failed to join transaction to delete orphan item: %d",
					  ret);
				return ret;
			}
			ret = btrfs_del_orphan_item(trans, tree_root, root_objectid);