diff options
author | Wang Shilong <wangsl-fnst@cn.fujitsu.com> | 2013-04-08 06:56:22 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-05-06 15:54:41 -0400 |
commit | 92f183aa5b8a8655431583e4c53e80fa3e0070e5 (patch) | |
tree | b46918ae6c8d1ab626c804603d11abc5e9628548 | |
parent | ddb47afa50f2f2713ef28d22380d3bf8fae648db (diff) |
Btrfs: use tree_root to avoid edquot when disabling quota
Steps to reproduce:
mkfs.btrfs <disk>
mount <disk> <mnt>
btrfs quota enable <mnt>
btrfs sub create <mnt>/subv
btrfs qgroup limit 10K <mnt>/subv
btrfs quota disable <mnt>/subv
It is wrong for qgroup to reserve when disabling quota,
so just use tree_root to avoid edquot when disabling quota.
Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
-rw-r--r-- | fs/btrfs/ioctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4fc9751d2e0c..ace88c1df540 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -3699,7 +3699,7 @@ static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg) | |||
3699 | 3699 | ||
3700 | down_write(&root->fs_info->subvol_sem); | 3700 | down_write(&root->fs_info->subvol_sem); |
3701 | if (sa->cmd != BTRFS_QUOTA_CTL_RESCAN) { | 3701 | if (sa->cmd != BTRFS_QUOTA_CTL_RESCAN) { |
3702 | trans = btrfs_start_transaction(root, 2); | 3702 | trans = btrfs_start_transaction(root->fs_info->tree_root, 2); |
3703 | if (IS_ERR(trans)) { | 3703 | if (IS_ERR(trans)) { |
3704 | ret = PTR_ERR(trans); | 3704 | ret = PTR_ERR(trans); |
3705 | goto out; | 3705 | goto out; |
@@ -3725,7 +3725,7 @@ static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg) | |||
3725 | ret = -EFAULT; | 3725 | ret = -EFAULT; |
3726 | 3726 | ||
3727 | if (trans) { | 3727 | if (trans) { |
3728 | err = btrfs_commit_transaction(trans, root); | 3728 | err = btrfs_commit_transaction(trans, root->fs_info->tree_root); |
3729 | if (err && !ret) | 3729 | if (err && !ret) |
3730 | ret = err; | 3730 | ret = err; |
3731 | } | 3731 | } |