btrfs_update_reloc_root will will return errors in the future, so handle
the error properly in commit_fs_roots.

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

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index c24ffbf0fb74..9dbbc354e5ad 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1353,7 +1353,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);
+                       ret2 = btrfs_update_reloc_root(trans, root);
+                       if (ret2)
+                               return ret2;
 
                        /* see comments in should_cow_block() */
                        clear_bit(BTRFS_ROOT_FORCE_COW, &root->state);
-- 
2.26.2

Reply via email to