]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: qgroup: return ENOTCONN instead of EINVAL when quotas are not enabled
authorMarcos Paulo de Souza <mpdesouza@suse.com>
Tue, 26 Nov 2019 00:58:51 +0000 (21:58 -0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 20 Jan 2020 15:40:50 +0000 (16:40 +0100)
commitf9a60e573ef03fa1e5687ff7f5a5e68f70584026
treecdca9abf601d77f83004dfcd1d19fe1fcadadfab
parent27911d725fb842f1e6a96efaaf779b832af1dd24
btrfs: qgroup: return ENOTCONN instead of EINVAL when quotas are not enabled

[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>
fs/btrfs/qgroup.c