hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/fs/btrfs/relocation.c
....@@ -1895,7 +1895,7 @@
18951895 list_splice(&reloc_roots, &rc->reloc_roots);
18961896
18971897 if (!err)
1898
- btrfs_commit_transaction(trans);
1898
+ err = btrfs_commit_transaction(trans);
18991899 else
19001900 btrfs_end_transaction(trans);
19011901 return err;
....@@ -3270,8 +3270,12 @@
32703270 */
32713271 return PTR_ERR(trans);
32723272 }
3273
- btrfs_commit_transaction(trans);
3274
- return 0;
3273
+
3274
+ ret = btrfs_commit_transaction(trans);
3275
+ if (ret)
3276
+ unset_reloc_control(rc);
3277
+
3278
+ return ret;
32753279 }
32763280
32773281 static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
....@@ -3443,7 +3447,9 @@
34433447 err = PTR_ERR(trans);
34443448 goto out_free;
34453449 }
3446
- btrfs_commit_transaction(trans);
3450
+ ret = btrfs_commit_transaction(trans);
3451
+ if (ret && !err)
3452
+ err = ret;
34473453 out_free:
34483454 ret = clean_dirty_subvols(rc);
34493455 if (ret < 0 && !err)