[PROBLEM]
qgroup create/remove code is currently returning EINVAL when the user
tries to create a qgroup on a subvolume without quota enabled. EINVAL is
already being used for too many error scenarios so that is hard to
depict what is the problem.
[FIX]
Currently scrub and balance code return -ENOTCONN when the user tries to
cancel/pause and no scrub or balance is currently running for the
desired subvolume. Do the same here by returning -ENOTCONN when a user
tries to create/delete/assing/list a qgroup on a subvolume without quota
enabled.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
mutex_lock(&fs_info->qgroup_ioctl_lock);
if (!fs_info->quota_root) {
- ret = -EINVAL;
+ ret = -ENOTCONN;
goto out;
}
member = find_qgroup_rb(fs_info, src);
return -ENOMEM;
if (!fs_info->quota_root) {
- ret = -EINVAL;
+ ret = -ENOTCONN;
goto out;
}
mutex_lock(&fs_info->qgroup_ioctl_lock);
if (!fs_info->quota_root) {
- ret = -EINVAL;
+ ret = -ENOTCONN;
goto out;
}
quota_root = fs_info->quota_root;
mutex_lock(&fs_info->qgroup_ioctl_lock);
if (!fs_info->quota_root) {
- ret = -EINVAL;
+ ret = -ENOTCONN;
goto out;
}
mutex_lock(&fs_info->qgroup_ioctl_lock);
if (!fs_info->quota_root) {
- ret = -EINVAL;
+ ret = -ENOTCONN;
goto out;
}