From 4bf4329a5de13a8c7ac81a94f40c79ce0ec678ea Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 09 2021 10:08:45 +0000 Subject: import xfsprogs-5.0.0-9.el8 --- diff --git a/SOURCES/xfsprogs-5.8.0-xfs_quota-command-error-message-improvement.patch b/SOURCES/xfsprogs-5.8.0-xfs_quota-command-error-message-improvement.patch new file mode 100644 index 0000000..eeec56c --- /dev/null +++ b/SOURCES/xfsprogs-5.8.0-xfs_quota-command-error-message-improvement.patch @@ -0,0 +1,76 @@ +From ca42fa70929e88781e7daeee4cf4588adb834661 Mon Sep 17 00:00:00 2001 +From: Bill O'Donnell +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 +Reviewed-by: Darrick J. Wong +Signed-off-by: Eric Sandeen +--- + 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 + diff --git a/SOURCES/xfsprogs-5.8.0-xfs_quota-display-warning-limits-when-printing-quota.patch b/SOURCES/xfsprogs-5.8.0-xfs_quota-display-warning-limits-when-printing-quota.patch new file mode 100644 index 0000000..f9f274b --- /dev/null +++ b/SOURCES/xfsprogs-5.8.0-xfs_quota-display-warning-limits-when-printing-quota.patch @@ -0,0 +1,52 @@ +From 387a96e12a937c1b2ee29a0f2c52245d6a283078 Mon Sep 17 00:00:00 2001 +From: "Darrick J. Wong" +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 +Reviewed-by: Christoph Hellwig +Signed-off-by: Eric Sandeen +--- + 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 + diff --git a/SOURCES/xfsprogs-5.8.0-xfs_quota-state-command-should-report-ugp-grace-time.patch b/SOURCES/xfsprogs-5.8.0-xfs_quota-state-command-should-report-ugp-grace-time.patch new file mode 100644 index 0000000..750be1b --- /dev/null +++ b/SOURCES/xfsprogs-5.8.0-xfs_quota-state-command-should-report-ugp-grace-time.patch @@ -0,0 +1,141 @@ +From d8a9454608ff97e98fb7de0da28f8d40804d2296 Mon Sep 17 00:00:00 2001 +From: Bill O'Donnell +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 +Reviewed-by: Darrick J. Wong +Reviewed-by: Christoph Hellwig +Signed-off-by: Eric Sandeen +--- + 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 + diff --git a/SPECS/xfsprogs.spec b/SPECS/xfsprogs.spec index b07b2c6..47d05ff 100644 --- a/SPECS/xfsprogs.spec +++ b/SPECS/xfsprogs.spec @@ -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 5.0.0-9 +- xfs_quota: state command should report ugp grace time (#1949743) + * Thu Jan 07 2021 Bill O'Donnell 5.0.0-8 - xfs_repair: Use proper min/max values in compute_level_geometry (#1910384)