From 92f183aa5b8a8655431583e4c53e80fa3e0070e5 Mon Sep 17 00:00:00 2001 From: Wang Shilong Date: Mon, 8 Apr 2013 10:56:22 +0000 Subject: [PATCH] Btrfs: use tree_root to avoid edquot when disabling quota Steps to reproduce: mkfs.btrfs mount btrfs quota enable btrfs sub create /subv btrfs qgroup limit 10K /subv btrfs quota disable /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 Signed-off-by: Josef Bacik --- fs/btrfs/ioctl.c | 4 ++-- 1 file 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) down_write(&root->fs_info->subvol_sem); if (sa->cmd != BTRFS_QUOTA_CTL_RESCAN) { - trans = btrfs_start_transaction(root, 2); + trans = btrfs_start_transaction(root->fs_info->tree_root, 2); if (IS_ERR(trans)) { ret = PTR_ERR(trans); goto out; @@ -3725,7 +3725,7 @@ static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg) ret = -EFAULT; if (trans) { - err = btrfs_commit_transaction(trans, root); + err = btrfs_commit_transaction(trans, root->fs_info->tree_root); if (err && !ret) ret = err; } -- 2.30.2