summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Písař <ppisar@redhat.com>2020-02-21 10:00:05 +0100
committerJan Kara <jack@suse.cz>2020-03-26 12:27:26 +0100
commit110b4a4011655fb650f82c88312ba44d7e249060 (patch)
tree64db778de41117a34118116946a6102e9e26521a
parent9a001cc6eb211758015d85cecc0464c94c82bbb5 (diff)
downloadlinuxquota-110b4a4011655fb650f82c88312ba44d7e249060.tar.gz
Fix ignoring disabled quotas
quota(1) command ignores file systems without enabled quotas. (In contrast to "quota -f".) This works for local file systems and it used to work for NFS file system until commit 4cd287f3fa38 ("rpc: Clarify error message when cannot connect to rpc.rquotad"). quota(1) command now reports an error whenever at least one NFS-mounted file system has disabled the quotas. This renders the tool unusable. This patch readds an exception for the ENOENT errno that was removed with the commit probably by a mistake. [JK: Improve commit message, make getprivs() print more descriptive message in case quota is not enabled] Signed-off-by: Petr Písař <ppisar@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--quotaops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/quotaops.c b/quotaops.c
index 1a8d7fe..ff4d16e 100644
--- a/quotaops.c
+++ b/quotaops.c
@@ -127,11 +127,13 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int ignore_noquo
char *estr;
/* If rpc.rquotad is not running, filesystem might be just without quotas... */
- if (ignore_noquota && errno == ECONNREFUSED)
+ if (ignore_noquota && (errno == ENOENT || errno == ECONNREFUSED))
continue;
if (errno == ECONNREFUSED) {
estr = _("Cannot connect to RPC quota service");
+ } else if (errno == ENOENT) {
+ estr = _("Quota not enabled");
} else {
estr = strerror(errno);
}