btrfs: qgroup: clear STATUS_FLAG_ON in disabling quota.
authorDongsheng Yang <yangds.fnst@cn.fujitsu.com>
Fri, 27 Feb 2015 08:24:26 +0000 (16:24 +0800)
committerChris Mason <clm@fb.com>
Mon, 13 Apr 2015 14:52:58 +0000 (07:52 -0700)
we forgot to clear STATUS_FLAG_ON in quota_disable(), it
will cause a problem shown as below:

# mount /dev/sdc /mnt
# btrfs quota enable /mnt
# btrfs quota disable /mnt
# btrfs quota rescan /mnt
quota rescan started <--- expecting it fail here.
# echo $?
0

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/qgroup.c

index 2e04e99f1e5b75d20f16850f69e5bdeaab151a39..f5f2baae7aa3929f34690e0ed6e9a7e60470a1b8 100644 (file)
@@ -966,6 +966,7 @@ int btrfs_quota_disable(struct btrfs_trans_handle *trans,
        fs_info->pending_quota_state = 0;
        quota_root = fs_info->quota_root;
        fs_info->quota_root = NULL;
+       fs_info->qgroup_flags &= ~BTRFS_QGROUP_STATUS_FLAG_ON;
        spin_unlock(&fs_info->qgroup_lock);
 
        btrfs_free_qgroup_config(fs_info);