import xfsprogs-5.0.0-9.el8

This commit is contained in:
CentOS Sources 2021-11-09 05:08:45 -05:00 committed by Stepan Oksanichenko
parent ca37d8c803
commit 2add3ba0d3
4 changed files with 279 additions and 1 deletions

View File

@ -0,0 +1,76 @@
From ca42fa70929e88781e7daeee4cf4588adb834661 Mon Sep 17 00:00:00 2001
From: Bill O'Donnell <billodo@redhat.com>
Date: Mon, 24 Aug 2020 13:23:23 -0400
Subject: [PATCH] xfs_quota: command error message improvement
Make the error messages for rudimentary xfs_quota commands
(off, enable, disable) more user friendly, instead of the
terse sys error outputs.
Signed-off-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
quota/state.c | 32 ++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)
diff --git a/quota/state.c b/quota/state.c
index 8f9718f1..7a595fc6 100644
--- a/quota/state.c
+++ b/quota/state.c
@@ -306,8 +306,16 @@ enable_enforcement(
return;
}
dir = mount->fs_name;
- if (xfsquotactl(XFS_QUOTAON, dir, type, 0, (void *)&qflags) < 0)
- perror("XFS_QUOTAON");
+ if (xfsquotactl(XFS_QUOTAON, dir, type, 0, (void *)&qflags) < 0) {
+ if (errno == EEXIST)
+ fprintf(stderr,
+ _("Quota enforcement already enabled.\n"));
+ else if (errno == EINVAL || errno == ENOSYS)
+ fprintf(stderr,
+ _("Can't enable enforcement when quota off.\n"));
+ else
+ perror("XFS_QUOTAON");
+ }
else if (flags & VERBOSE_FLAG)
state_quotafile_mount(stdout, type, mount, flags);
}
@@ -328,8 +336,16 @@ disable_enforcement(
return;
}
dir = mount->fs_name;
- if (xfsquotactl(XFS_QUOTAOFF, dir, type, 0, (void *)&qflags) < 0)
- perror("XFS_QUOTAOFF");
+ if (xfsquotactl(XFS_QUOTAOFF, dir, type, 0, (void *)&qflags) < 0) {
+ if (errno == EEXIST)
+ fprintf(stderr,
+ _("Quota enforcement already disabled.\n"));
+ else if (errno == EINVAL || errno == ENOSYS)
+ fprintf(stderr,
+ _("Can't disable enforcement when quota off.\n"));
+ else
+ perror("XFS_QUOTAOFF");
+ }
else if (flags & VERBOSE_FLAG)
state_quotafile_mount(stdout, type, mount, flags);
}
@@ -350,8 +366,12 @@ quotaoff(
return;
}
dir = mount->fs_name;
- if (xfsquotactl(XFS_QUOTAOFF, dir, type, 0, (void *)&qflags) < 0)
- perror("XFS_QUOTAOFF");
+ if (xfsquotactl(XFS_QUOTAOFF, dir, type, 0, (void *)&qflags) < 0) {
+ if (errno == EEXIST || errno == ENOSYS)
+ fprintf(stderr, _("Quota already off.\n"));
+ else
+ perror("XFS_QUOTAOFF");
+ }
else if (flags & VERBOSE_FLAG)
state_quotafile_mount(stdout, type, mount, flags);
}
--
2.31.1

View File

@ -0,0 +1,52 @@
From 387a96e12a937c1b2ee29a0f2c52245d6a283078 Mon Sep 17 00:00:00 2001
From: "Darrick J. Wong" <darrick.wong@oracle.com>
Date: Mon, 24 Aug 2020 13:23:32 -0400
Subject: [PATCH] xfs_quota: display warning limits when printing quota type
information
We should dump the default warning limits when we're printing quota
information.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
quota/state.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/quota/state.c b/quota/state.c
index 7a595fc6..1627181d 100644
--- a/quota/state.c
+++ b/quota/state.c
@@ -130,6 +130,16 @@ state_timelimit(
time_to_string(timelimit, VERBOSE_FLAG | ABSOLUTE_FLAG));
}
+static void
+state_warnlimit(
+ FILE *fp,
+ uint form,
+ uint16_t warnlimit)
+{
+ fprintf(fp, _("%s max warnings: %u\n"),
+ form_to_string(form), warnlimit);
+}
+
/*
* fs_quota_stat holds a subset of fs_quota_statv; this copies
* the smaller into the larger, leaving any not-present fields
@@ -218,7 +228,11 @@ state_quotafile_mount(
sv.qs_flags & XFS_QUOTA_PDQ_ENFD);
state_timelimit(fp, XFS_BLOCK_QUOTA, sv.qs_btimelimit);
+ state_warnlimit(fp, XFS_BLOCK_QUOTA, sv.qs_bwarnlimit);
+
state_timelimit(fp, XFS_INODE_QUOTA, sv.qs_itimelimit);
+ state_warnlimit(fp, XFS_INODE_QUOTA, sv.qs_iwarnlimit);
+
state_timelimit(fp, XFS_RTBLOCK_QUOTA, sv.qs_rtbtimelimit);
}
--
2.31.1

View File

@ -0,0 +1,141 @@
From d8a9454608ff97e98fb7de0da28f8d40804d2296 Mon Sep 17 00:00:00 2001
From: Bill O'Donnell <billodo@redhat.com>
Date: Mon, 24 Aug 2020 13:23:43 -0400
Subject: [PATCH] xfs_quota: state command should report ugp grace times
Since grace periods are now supported for three quota types (ugp),
modify xfs_quota state command to report times for all three.
Add a helper function for stat reporting.
Signed-off-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
quota/state.c | 96 +++++++++++++++++++++++++++++++++++----------------
1 file changed, 67 insertions(+), 29 deletions(-)
diff --git a/quota/state.c b/quota/state.c
index 1627181d..19d34ed0 100644
--- a/quota/state.c
+++ b/quota/state.c
@@ -191,49 +191,87 @@ state_stat_to_statv(
}
static void
-state_quotafile_mount(
+state_quotafile_stat(
FILE *fp,
uint type,
- struct fs_path *mount,
+ struct fs_path *mount,
+ struct fs_quota_statv *sv,
+ struct fs_quota_stat *s,
uint flags)
{
- struct fs_quota_stat s;
- struct fs_quota_statv sv;
+ bool accounting, enforcing;
+ struct fs_qfilestatv *qsv;
char *dev = mount->fs_name;
- sv.qs_version = FS_QSTATV_VERSION1;
-
- if (xfsquotactl(XFS_GETQSTATV, dev, type, 0, (void *)&sv) < 0) {
- if (xfsquotactl(XFS_GETQSTAT, dev, type, 0, (void *)&s) < 0) {
+ if (xfsquotactl(XFS_GETQSTATV, dev, type, 0, (void *)sv) < 0) {
+ if (xfsquotactl(XFS_GETQSTAT, dev, type, 0, (void *)s) < 0) {
if (flags & VERBOSE_FLAG)
fprintf(fp,
_("%s quota are not enabled on %s\n"),
type_to_string(type), dev);
return;
}
- state_stat_to_statv(&s, &sv);
+ state_stat_to_statv(s, sv);
+ }
+
+ switch(type) {
+ case XFS_USER_QUOTA:
+ qsv = &sv->qs_uquota;
+ accounting = sv->qs_flags & XFS_QUOTA_UDQ_ACCT;
+ enforcing = sv->qs_flags & XFS_QUOTA_UDQ_ENFD;
+ break;
+ case XFS_GROUP_QUOTA:
+ qsv = &sv->qs_gquota;
+ accounting = sv->qs_flags & XFS_QUOTA_GDQ_ACCT;
+ enforcing = sv->qs_flags & XFS_QUOTA_GDQ_ENFD;
+ break;
+ case XFS_PROJ_QUOTA:
+ qsv = &sv->qs_pquota;
+ accounting = sv->qs_flags & XFS_QUOTA_PDQ_ACCT;
+ enforcing = sv->qs_flags & XFS_QUOTA_PDQ_ENFD;
+ break;
+ default:
+ return;
}
- if (type & XFS_USER_QUOTA)
- state_qfilestat(fp, mount, XFS_USER_QUOTA, &sv.qs_uquota,
- sv.qs_flags & XFS_QUOTA_UDQ_ACCT,
- sv.qs_flags & XFS_QUOTA_UDQ_ENFD);
- if (type & XFS_GROUP_QUOTA)
- state_qfilestat(fp, mount, XFS_GROUP_QUOTA, &sv.qs_gquota,
- sv.qs_flags & XFS_QUOTA_GDQ_ACCT,
- sv.qs_flags & XFS_QUOTA_GDQ_ENFD);
- if (type & XFS_PROJ_QUOTA)
- state_qfilestat(fp, mount, XFS_PROJ_QUOTA, &sv.qs_pquota,
- sv.qs_flags & XFS_QUOTA_PDQ_ACCT,
- sv.qs_flags & XFS_QUOTA_PDQ_ENFD);
-
- state_timelimit(fp, XFS_BLOCK_QUOTA, sv.qs_btimelimit);
- state_warnlimit(fp, XFS_BLOCK_QUOTA, sv.qs_bwarnlimit);
-
- state_timelimit(fp, XFS_INODE_QUOTA, sv.qs_itimelimit);
- state_warnlimit(fp, XFS_INODE_QUOTA, sv.qs_iwarnlimit);
-
- state_timelimit(fp, XFS_RTBLOCK_QUOTA, sv.qs_rtbtimelimit);
+
+ state_qfilestat(fp, mount, type, qsv, accounting, enforcing);
+
+ state_timelimit(fp, XFS_BLOCK_QUOTA, sv->qs_btimelimit);
+ state_warnlimit(fp, XFS_BLOCK_QUOTA, sv->qs_bwarnlimit);
+
+ state_timelimit(fp, XFS_INODE_QUOTA, sv->qs_itimelimit);
+ state_warnlimit(fp, XFS_INODE_QUOTA, sv->qs_iwarnlimit);
+
+ state_timelimit(fp, XFS_RTBLOCK_QUOTA, sv->qs_rtbtimelimit);
+}
+
+static void
+state_quotafile_mount(
+ FILE *fp,
+ uint type,
+ struct fs_path *mount,
+ uint flags)
+{
+ struct fs_quota_stat s;
+ struct fs_quota_statv sv;
+
+ sv.qs_version = FS_QSTATV_VERSION1;
+
+ if (type & XFS_USER_QUOTA) {
+ state_quotafile_stat(fp, XFS_USER_QUOTA, mount,
+ &sv, &s, flags);
+ }
+
+ if (type & XFS_GROUP_QUOTA) {
+ state_quotafile_stat(fp, XFS_GROUP_QUOTA, mount,
+ &sv, &s, flags);
+ }
+
+ if (type & XFS_PROJ_QUOTA) {
+ state_quotafile_stat(fp, XFS_PROJ_QUOTA, mount,
+ &sv, &s, flags);
+ }
}
static void
--
2.31.1

View File

@ -1,7 +1,7 @@
Summary: Utilities for managing the XFS filesystem
Name: xfsprogs
Version: 5.0.0
Release: 8%{?dist}
Release: 9%{?dist}
License: GPL+ and LGPLv2+
Group: System Environment/Base
URL: https://xfs.wiki.kernel.org
@ -37,6 +37,9 @@ Patch16: xfsprogs-5.7.0-xfs_repair-fix-rebuilding-btree-block-less-than-minr.pat
Patch17: xfsprogs-5.10.0-xfs_quota-document-how-the-default-quota-is-stored.patch
Patch18: xfsprogs-5.8.0-xfs_db-short-circuit-type_f-if-type-is-unchanged.patch
Patch19: xfsprogs-5.10.0-xfs_repair-Use-proper-min-max-values-in-compute_level_geometry.patch
Patch20: xfsprogs-5.8.0-xfs_quota-command-error-message-improvement.patch
Patch21: xfsprogs-5.8.0-xfs_quota-display-warning-limits-when-printing-quota.patch
Patch22: xfsprogs-5.8.0-xfs_quota-state-command-should-report-ugp-grace-time.patch
%description
A set of commands to use the XFS filesystem, including mkfs.xfs.
@ -87,6 +90,9 @@ also want to install xfsprogs.
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%build
export tagname=CC
@ -146,6 +152,9 @@ rm -rf $RPM_BUILD_ROOT/%{_mandir}/man8/xfs_scrub*
%{_libdir}/*.so
%changelog
* Thu Jul 08 2021 Bill O'Donnell <bodonnel@redhat.com> 5.0.0-9
- xfs_quota: state command should report ugp grace time (#1949743)
* Thu Jan 07 2021 Bill O'Donnell <billodo@redhat.com> 5.0.0-8
- xfs_repair: Use proper min/max values in compute_level_geometry (#1910384)