diff options
author | Wang Shilong <wangsl-fnst@cn.fujitsu.com> | 2013-02-20 09:16:14 -0500 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-02-20 13:00:07 -0500 |
commit | 683cebda90787730d5260eac0da7c2bff9fb40ef (patch) | |
tree | e2ed3c2cb509502daef0bbe149c53b1f0f7a9342 /fs/btrfs/qgroup.c | |
parent | fa6ac8765c48a06dfed914e8c8c3a903f9d313a0 (diff) |
Btrfs: fix missing check before disabling quota
The original code forget to check whether quota has been disabled firstly,
and it will return 'EINVAL' and return error to users if quota has been
disabled,it will be unfriendly and confusing for users to see that.
So just return directly if quota has been disabled.
Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
Cc: Arne Jansen <sensille@gmx.net>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/qgroup.c')
-rw-r--r-- | fs/btrfs/qgroup.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index a0d6368249fa..88ab785bbd73 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c | |||
@@ -847,6 +847,10 @@ int btrfs_quota_disable(struct btrfs_trans_handle *trans, | |||
847 | int ret = 0; | 847 | int ret = 0; |
848 | 848 | ||
849 | spin_lock(&fs_info->qgroup_lock); | 849 | spin_lock(&fs_info->qgroup_lock); |
850 | if (!fs_info->quota_root) { | ||
851 | spin_unlock(&fs_info->qgroup_lock); | ||
852 | return 0; | ||
853 | } | ||
850 | fs_info->quota_enabled = 0; | 854 | fs_info->quota_enabled = 0; |
851 | fs_info->pending_quota_state = 0; | 855 | fs_info->pending_quota_state = 0; |
852 | quota_root = fs_info->quota_root; | 856 | quota_root = fs_info->quota_root; |