Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 499d29bf authored by Josef Bacik's avatar Josef Bacik Committed by Greg Kroah-Hartman
Browse files

btrfs: check return value of btrfs_commit_transaction in relocation



commit fb686c6824dd6294ca772b92424b8fba666e7d00 upstream.

There are a few places where we don't check the return value of
btrfs_commit_transaction in relocation.c.  Thankfully all these places
have straightforward error handling, so simply change all of the sites
at once.

Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarStefan Ghinea <stefan.ghinea@windriver.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 55b55f3f
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -2341,7 +2341,7 @@ int prepare_to_merge(struct reloc_control *rc, int err)
	list_splice(&reloc_roots, &rc->reloc_roots);

	if (!err)
		btrfs_commit_transaction(trans);
		err = btrfs_commit_transaction(trans);
	else
		btrfs_end_transaction(trans);
	return err;
@@ -3930,8 +3930,7 @@ int prepare_to_relocate(struct reloc_control *rc)
		 */
		return PTR_ERR(trans);
	}
	btrfs_commit_transaction(trans);
	return 0;
	return btrfs_commit_transaction(trans);
}

static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
@@ -4097,7 +4096,9 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
		err = PTR_ERR(trans);
		goto out_free;
	}
	btrfs_commit_transaction(trans);
	ret = btrfs_commit_transaction(trans);
	if (ret && !err)
		err = ret;
out_free:
	btrfs_free_block_rsv(fs_info, rc->block_rsv);
	btrfs_free_path(path);