diff --git a/quota-4.05-quota-tools-pass-quota-type-to-QCMD-for-Q_XFS_GETQST.patch b/quota-4.05-quota-tools-pass-quota-type-to-QCMD-for-Q_XFS_GETQST.patch new file mode 100644 index 0000000..d1e987e --- /dev/null +++ b/quota-4.05-quota-tools-pass-quota-type-to-QCMD-for-Q_XFS_GETQST.patch @@ -0,0 +1,56 @@ +From fdd774bf08e56872ae4c0420e0f01efa25e715d6 Mon Sep 17 00:00:00 2001 +From: Eric Sandeen +Date: Fri, 8 May 2020 14:36:46 -0500 +Subject: [PATCH] quota-tools: pass quota type to QCMD for Q_XFS_GETQSTAT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Older kernels ignored the type sent to Q_XFS_GETQSTAT, and returned +timer information for the first quota type which was found to be +enabled. + +As of 555b2c3da1fc ("quota: honor quota type in Q_XGETQSTAT[V] calls") +the kernel now honors the quota type requested, so send that from the +Q_XFS_GETQSTAT calls in quota tools. + +Older kernels ignore the type altogether, so this change should be +backwards compatible with no change in behavior. + +Signed-off-by: Eric Sandeen +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotaio_xfs.c | 2 +- + quotaon_xfs.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/quotaio_xfs.c b/quotaio_xfs.c +index 56daf89..b22c7b4 100644 +--- a/quotaio_xfs.c ++++ b/quotaio_xfs.c +@@ -81,7 +81,7 @@ static int xfs_init_io(struct quota_handle *h) + struct xfs_mem_dqinfo info; + int qcmd; + +- qcmd = QCMD(Q_XFS_GETQSTAT, 0); ++ qcmd = QCMD(Q_XFS_GETQSTAT, h->qh_type); + memset(&info, 0, sizeof(struct xfs_mem_dqinfo)); + if (quotactl(qcmd, h->qh_quotadev, 0, (void *)&info) < 0) + return -1; +diff --git a/quotaon_xfs.c b/quotaon_xfs.c +index d557a75..d137240 100644 +--- a/quotaon_xfs.c ++++ b/quotaon_xfs.c +@@ -32,7 +32,7 @@ static int xfs_state_check(int qcmd, int type, int flags, const char *dev, int r + if (flags & STATEFLAG_ALL) + return 0; /* noop */ + +- if (quotactl(QCMD(Q_XFS_GETQSTAT, 0), dev, 0, (void *)&info) < 0) { ++ if (quotactl(QCMD(Q_XFS_GETQSTAT, type), dev, 0, (void *)&info) < 0) { + errstr(_("quotactl() on %s: %s\n"), dev, strerror(errno)); + return -1; + } +-- +2.25.4 + diff --git a/quota.spec b/quota.spec index 680d016..e0642dd 100644 --- a/quota.spec +++ b/quota.spec @@ -13,7 +13,7 @@ Name: quota Epoch: 1 Version: 4.05 -Release: 10%{?dist} +Release: 11%{?dist} Summary: System administration tools for monitoring users' disk usage # quota_nld.c, quotaio_xfs.h: GPLv2 # bylabel.c copied from util-linux: GPLv2+ @@ -102,6 +102,8 @@ Patch17: quota-4.05-warnquota-Initialize-all-members-of-a-configparams-s.patch # Fix ignoring disabled quotas, bug #1805110, in upstream after 4.05, # Patch18: quota-4.05-Fix-ignoring-disabled-quotas.patch +# Pass quota type for Q_XFS_GETQSTAT, in upstream after 4.05 +Patch19: quota-4.05-quota-tools-pass-quota-type-to-QCMD-for-Q_XFS_GETQST.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: bash @@ -240,6 +242,7 @@ Linux/UNIX environment. %patch16 -p1 %patch17 -p1 %patch18 -p1 +%patch19 -p1 # Regenerate build scripts autoreconf -f -i @@ -389,6 +392,9 @@ make check %changelog +* Mon May 11 2020 Petr Pisar - 1:4.05-11 +- Pass quota type for Q_XFS_GETQSTAT + * Thu Mar 26 2020 Petr Pisar - 1:4.05-10 - Use an upstream's patch for ignoring disabled quotas (bug #1805110)