diff mbox

[5/7] btrfs: qgroup: clear STATUS_FLAG_ON in disabling quota.

Message ID 1425025468-29749-6-git-send-email-quwenruo@cn.fujitsu.com (mailing list archive)
State Accepted
Headers show

Commit Message

Qu Wenruo Feb. 27, 2015, 8:24 a.m. UTC
From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>

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>
---
 fs/btrfs/qgroup.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Josef Bacik March 2, 2015, 9:55 p.m. UTC | #1
On 02/27/2015 03:24 AM, Qu Wenruo wrote:
> From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
>
> 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>

Thanks,

Josef
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 20fe219..b48f2c8 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -967,6 +967,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);