|
@@ -4491,7 +4491,12 @@ again:
|
|
|
|
|
|
/* Now btrfs_update_device() will change the on-disk size. */
|
|
/* Now btrfs_update_device() will change the on-disk size. */
|
|
ret = btrfs_update_device(trans, device);
|
|
ret = btrfs_update_device(trans, device);
|
|
- btrfs_end_transaction(trans);
|
|
|
|
|
|
+ if (ret < 0) {
|
|
|
|
+ btrfs_abort_transaction(trans, ret);
|
|
|
|
+ btrfs_end_transaction(trans);
|
|
|
|
+ } else {
|
|
|
|
+ ret = btrfs_commit_transaction(trans);
|
|
|
|
+ }
|
|
done:
|
|
done:
|
|
btrfs_free_path(path);
|
|
btrfs_free_path(path);
|
|
if (ret) {
|
|
if (ret) {
|