Use an upstream's patch for ignoring disabled quotas

This commit is contained in:
Petr Písař 2020-03-26 16:54:18 +01:00
parent 467ef82fdb
commit a79338e43d
2 changed files with 25 additions and 26 deletions

View File

@ -1,4 +1,4 @@
From 514cfb367e9c673c9c18b84a9c9c94ea84b91112 Mon Sep 17 00:00:00 2001
From 110b4a4011655fb650f82c88312ba44d7e249060 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Fri, 21 Feb 2020 10:00:05 +0100
Subject: [PATCH] Fix ignoring disabled quotas
@ -6,40 +6,30 @@ MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
"quota" command ignores file systems without enabled quotas. (In
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 this commit:
commit 4cd287f3fa3838a31eb6636366f8ce26ee6e1425
Author: Jan Kara <jack@suse.cz>
Date: Tue May 28 10:52:49 2019 +0200
rpc: Clarify error message when cannot connect to rpc.rquotad
Currently when RPC rquota service is not registered, we report somewhat
confusing "No such file of directory" error. For other errors when
creating rquota request we report "Connection refused". There's no big
difference for user between these errors and neither of them tells what
really happened. So just unify handling of these errors and report more
general error telling the user where the problem is.
that broke it. "quota" command now reports an error whenever at least
one NFS-mounted file system has disabled the quotas. This renders the
tool unusable.
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>
---
quotaops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
quotaops.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/quotaops.c b/quotaops.c
index 1a8d7fe..0daa8ec 100644
index 1a8d7fe..ff4d16e 100644
--- a/quotaops.c
+++ b/quotaops.c
@@ -127,7 +127,7 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int ignore_noquo
@@ -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... */
@ -48,6 +38,12 @@ index 1a8d7fe..0daa8ec 100644
continue;
if (errno == ECONNREFUSED) {
estr = _("Cannot connect to RPC quota service");
+ } else if (errno == ENOENT) {
+ estr = _("Quota not enabled");
} else {
estr = strerror(errno);
}
--
2.21.1

View File

@ -13,7 +13,7 @@
Name: quota
Epoch: 1
Version: 4.05
Release: 9%{?dist}
Release: 10%{?dist}
Summary: System administration tools for monitoring users' disk usage
# quota_nld.c, quotaio_xfs.h: GPLv2
# bylabel.c copied from util-linux: GPLv2+
@ -99,7 +99,7 @@ Patch16: quota-4.05-warnquota-Clarify-that-CC_TO-gets-resolved-through-L.patch
# Initialize all members of a configparams structure in warnquota,
# in upstream after 4.05, <https://sourceforge.net/p/linuxquota/patches/51/>
Patch17: quota-4.05-warnquota-Initialize-all-members-of-a-configparams-s.patch
# Fix ignoring disabled quotas, bug #1805110, proposed to upstream,
# Fix ignoring disabled quotas, bug #1805110, in upstream after 4.05,
# <https://sourceforge.net/p/linuxquota/bugs/136/>
Patch18: quota-4.05-Fix-ignoring-disabled-quotas.patch
BuildRequires: autoconf
@ -389,6 +389,9 @@ make check
%changelog
* Thu Mar 26 2020 Petr Pisar <ppisar@redhat.com> - 1:4.05-10
- Use an upstream's patch for ignoring disabled quotas (bug #1805110)
* Fri Feb 21 2020 Petr Pisar <ppisar@redhat.com> - 1:4.05-9
- Fix ignoring disabled quotas (bug #1805110)