diff options
-rw-r--r-- | fs/btrfs/ioctl.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 14c0d2e0790c..e262cd8c4a7d 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -571,8 +571,12 @@ static int create_snapshot(struct btrfs_root *root, struct dentry *dentry, | |||
571 | ret = btrfs_commit_transaction(trans, | 571 | ret = btrfs_commit_transaction(trans, |
572 | root->fs_info->extent_root); | 572 | root->fs_info->extent_root); |
573 | } | 573 | } |
574 | if (ret) | 574 | if (ret) { |
575 | /* cleanup_transaction has freed this for us */ | ||
576 | if (trans->aborted) | ||
577 | pending_snapshot = NULL; | ||
575 | goto fail; | 578 | goto fail; |
579 | } | ||
576 | 580 | ||
577 | ret = pending_snapshot->error; | 581 | ret = pending_snapshot->error; |
578 | if (ret) | 582 | if (ret) |