diff mbox series

[v6,31/52] btrfs: handle btrfs_update_reloc_root failure in commit_fs_roots

Message ID dbe2c5c34223e1cfa9fb8b538930b893cba6d825.1607444471.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series | expand

Commit Message

Josef Bacik Dec. 8, 2020, 4:23 p.m. UTC
btrfs_update_reloc_root will will return errors in the future, so handle
the error properly in commit_fs_roots.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/transaction.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 375aa2bed36d..dd60590685c0 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1343,7 +1343,9 @@  static noinline int commit_fs_roots(struct btrfs_trans_handle *trans)
 			spin_unlock(&fs_info->fs_roots_radix_lock);
 
 			btrfs_free_log(trans, root);
-			btrfs_update_reloc_root(trans, root);
+			err = btrfs_update_reloc_root(trans, root);
+			if (err)
+				return err;
 
 			/* see comments in should_cow_block() */
 			clear_bit(BTRFS_ROOT_FORCE_COW, &root->state);