diff options
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 224da287b3ed..0b63c3c77cfd 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -715,7 +715,12 @@ long btrfs_ioctl_trans_start(struct file *file) | |||
715 | ret = -EINPROGRESS; | 715 | ret = -EINPROGRESS; |
716 | goto out; | 716 | goto out; |
717 | } | 717 | } |
718 | trans = btrfs_start_transaction(root, 0); | 718 | |
719 | mutex_lock(&root->fs_info->trans_mutex); | ||
720 | root->fs_info->open_ioctl_trans++; | ||
721 | mutex_unlock(&root->fs_info->trans_mutex); | ||
722 | |||
723 | trans = btrfs_start_ioctl_transaction(root, 0); | ||
719 | if (trans) | 724 | if (trans) |
720 | file->private_data = trans; | 725 | file->private_data = trans; |
721 | else | 726 | else |
@@ -745,6 +750,11 @@ long btrfs_ioctl_trans_end(struct file *file) | |||
745 | } | 750 | } |
746 | btrfs_end_transaction(trans, root); | 751 | btrfs_end_transaction(trans, root); |
747 | file->private_data = 0; | 752 | file->private_data = 0; |
753 | |||
754 | mutex_lock(&root->fs_info->trans_mutex); | ||
755 | root->fs_info->open_ioctl_trans--; | ||
756 | mutex_unlock(&root->fs_info->trans_mutex); | ||
757 | |||
748 | out: | 758 | out: |
749 | return ret; | 759 | return ret; |
750 | } | 760 | } |