diff options
author | Josef Bacik <josef@toxicpanda.com> | 2020-11-12 15:38:38 -0500 |
---|---|---|
committer | Josef Bacik <josef@toxicpanda.com> | 2020-12-16 11:14:49 -0500 |
commit | 1a52fe84b41022f24cea283cbc621e2bbde2183b (patch) | |
tree | 926eea328aad0207dfc8893151552e8ff638c90d | |
parent | 9af73ba5d4672c235ce5c4ae5033c026e3f57a73 (diff) | |
download | btrfs-next-reloc-work.tar.gz |
btrfs: check return value of btrfs_commit_transaction in relocationreloc-work
There's 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: Qu Wenruo <wqu@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
-rw-r--r-- | fs/btrfs/relocation.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 44743d1fe4143..26ecc55e9f59a 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -1915,7 +1915,7 @@ again: 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; @@ -3450,8 +3450,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) @@ -3610,7 +3609,9 @@ restart: err = PTR_ERR(trans); goto out_free; } - btrfs_commit_transaction(trans); + ret = btrfs_commit_transaction(trans); + if (ret && !err) + err = ret; out_free: ret = clean_dirty_subvols(rc); if (ret < 0 && !err) |