btrfs: remove BTRFS_FS_QUOTA_DISABLING flag
authorMisono, Tomohiro <misono.tomohiro@jp.fujitsu.com>
Wed, 30 Aug 2017 07:33:16 +0000 (16:33 +0900)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Sep 2017 12:52:57 +0000 (14:52 +0200)
commitc2faff790ccd11ea5be8e3ca99713f116fcd6030
tree181c8e3c5283150a48bf8c2f1aa1335692cc196f
parent78ad4ce014d025f41b8dde3a81876832ead643cf
btrfs: remove BTRFS_FS_QUOTA_DISABLING flag

Currently, "btrfs quota enable" would fail after "btrfs quota disable" on
the first time with syslog output "qgroup_rescan_init failed with -22", but
it would succeed on the second time.

When "quota disable" is called, BTRFS_FS_QUOTA_DISABLING flag bit will be
set in fs_info->flags in btrfs_quota_disable(), but it will not be droppd
in btrfs_run_qgroups() (which is called in btrfs_commit_transaction())
because quota_root has already been freed. If "quota enable" is called
after that, both BTRFS_FS_QUOTA_DISABLING and BTRFS_FS_QUOTA_ENABLED flag
would be dropped in the btrfs_run_qgroups() since quota_root is not NULL.
This leads to the failure of "quota enable" on the first time.

BTRFS_FS_QUOTA_DISABLING flag is not used outside of "quota disable"
context and is equivalent to whether quota_root is NULL or not.
btrfs_run_qgroups() checks whether quota_root is NULL or not in the first
place.

So, let's remove BTRFS_FS_QUOTA_DISABLING flag.

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/qgroup.c