Skip to content

Commit

Permalink
Btrfs: fix missing check before disabling quota
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wang Shilong authored and Josef Bacik committed Feb 20, 2013
1 parent fa6ac87 commit 683cebd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/btrfs/qgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,10 @@ int btrfs_quota_disable(struct btrfs_trans_handle *trans,
int ret = 0;

spin_lock(&fs_info->qgroup_lock);
if (!fs_info->quota_root) {
spin_unlock(&fs_info->qgroup_lock);
return 0;
}
fs_info->quota_enabled = 0;
fs_info->pending_quota_state = 0;
quota_root = fs_info->quota_root;
Expand Down

0 comments on commit 683cebd

Please sign in to comment.