summaryrefslogtreecommitdiff
path: root/cmds-qgroup.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-01-20 17:52:12 +0100
committerDavid Sterba <dsterba@suse.com>2017-01-25 09:47:58 +0100
commit7610cbf729003952f76fddf67439fc0499139ff6 (patch)
treed28c069c62fecb61fb79ad0fc01fc8420e2b45ec /cmds-qgroup.c
parent4415ff6bcc3fbbe6f9c043fadc19989d772da835 (diff)
btrfs-progs: qgroup show: refine error messages
When qgroup show is called on a filesystem that does not have quotas enabled, the error message is very unclear: ERROR: can't perform the search - No such file or directory ERROR: can't list qgroups: No such file or director Remove the error from low level helper and let the command handler decide what to print. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-qgroup.c')
-rw-r--r--cmds-qgroup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmds-qgroup.c b/cmds-qgroup.c
index 59a5926b..d0f10dd4 100644
--- a/cmds-qgroup.c
+++ b/cmds-qgroup.c
@@ -382,9 +382,11 @@ static int cmd_qgroup_show(int argc, char **argv)
qgroupid);
}
ret = btrfs_show_qgroups(fd, filter_set, comparer_set);
- close_file_or_dir(fd, dirstream);
- if (ret < 0)
+ if (ret == -ENOENT)
+ error("can't list qgroups: quotas not enabled");
+ else if (ret < 0)
error("can't list qgroups: %s", strerror(-ret));
+ close_file_or_dir(fd, dirstream);
out:
return !!ret;