mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-11 03:31:17 +00:00
btrfs-progs: subvol show: don't return error if quotas are not enabled
The command 'subvolume show' would return error code in case quotas are not enabled or in any other error. In case they're not enabled, it's not fatal, no-qgroup setups are quite common. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ceacaa112e
commit
f0aab17fc0
@ -1129,20 +1129,23 @@ static int cmd_subvol_show(const struct cmd_struct *cmd, int argc, char **argv)
|
||||
btrfs_util_destroy_subvolume_iterator(iter);
|
||||
|
||||
ret = btrfs_qgroup_query(fd, subvol.id, &stats);
|
||||
if (ret && ret != -ENOTTY && ret != -ENODATA) {
|
||||
fprintf(stderr,
|
||||
"\nERROR: BTRFS_IOC_QUOTA_QUERY failed: %s\n",
|
||||
strerror(-ret));
|
||||
if (ret == -ENOTTY) {
|
||||
/* Quotas not enabled */
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
if (ret == -ENOTTY) {
|
||||
/* Quota information not available, not fatal */
|
||||
printf("\tQuota group:\t\tn/a\n");
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
if (ret == -ENOTTY)
|
||||
printf("quotas not enabled\n");
|
||||
else
|
||||
printf("quotas not available\n");
|
||||
fprintf(stderr, "ERROR: quota query failed: %m");
|
||||
goto out;
|
||||
}
|
||||
|
||||
printf("\tQuota group:\t\t0/%" PRIu64 "\n", subvol.id);
|
||||
fflush(stdout);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user