|
@@ -571,8 +571,12 @@ static int create_snapshot(struct btrfs_root *root, struct dentry *dentry,
|
|
ret = btrfs_commit_transaction(trans,
|
|
ret = btrfs_commit_transaction(trans,
|
|
root->fs_info->extent_root);
|
|
root->fs_info->extent_root);
|
|
}
|
|
}
|
|
- if (ret)
|
|
|
|
|
|
+ if (ret) {
|
|
|
|
+ /* cleanup_transaction has freed this for us */
|
|
|
|
+ if (trans->aborted)
|
|
|
|
+ pending_snapshot = NULL;
|
|
goto fail;
|
|
goto fail;
|
|
|
|
+ }
|
|
|
|
|
|
ret = pending_snapshot->error;
|
|
ret = pending_snapshot->error;
|
|
if (ret)
|
|
if (ret)
|