| .. | .. |
|---|
| 1895 | 1895 | list_splice(&reloc_roots, &rc->reloc_roots); |
|---|
| 1896 | 1896 | |
|---|
| 1897 | 1897 | if (!err) |
|---|
| 1898 | | - btrfs_commit_transaction(trans); |
|---|
| 1898 | + err = btrfs_commit_transaction(trans); |
|---|
| 1899 | 1899 | else |
|---|
| 1900 | 1900 | btrfs_end_transaction(trans); |
|---|
| 1901 | 1901 | return err; |
|---|
| .. | .. |
|---|
| 3270 | 3270 | */ |
|---|
| 3271 | 3271 | return PTR_ERR(trans); |
|---|
| 3272 | 3272 | } |
|---|
| 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; |
|---|
| 3275 | 3279 | } |
|---|
| 3276 | 3280 | |
|---|
| 3277 | 3281 | static noinline_for_stack int relocate_block_group(struct reloc_control *rc) |
|---|
| .. | .. |
|---|
| 3443 | 3447 | err = PTR_ERR(trans); |
|---|
| 3444 | 3448 | goto out_free; |
|---|
| 3445 | 3449 | } |
|---|
| 3446 | | - btrfs_commit_transaction(trans); |
|---|
| 3450 | + ret = btrfs_commit_transaction(trans); |
|---|
| 3451 | + if (ret && !err) |
|---|
| 3452 | + err = ret; |
|---|
| 3447 | 3453 | out_free: |
|---|
| 3448 | 3454 | ret = clean_dirty_subvols(rc); |
|---|
| 3449 | 3455 | if (ret < 0 && !err) |
|---|