From cd338245216a23221b2cc6cd9cd9943c88b29801 Mon Sep 17 00:00:00 2001 From: liuh Date: Tue, 30 Sep 2025 16:57:27 +0800 Subject: [PATCH] mkfs: fix the issue of maxpct set to 0 not taking effect --- ...ue-of-maxpct-set-to-0-not-taking-eff.patch | 51 +++++++++++++++++++ xfsprogs.spec | 5 +- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 0008-mkfs-fix-the-issue-of-maxpct-set-to-0-not-taking-eff.patch diff --git a/0008-mkfs-fix-the-issue-of-maxpct-set-to-0-not-taking-eff.patch b/0008-mkfs-fix-the-issue-of-maxpct-set-to-0-not-taking-eff.patch new file mode 100644 index 0000000..f0788d5 --- /dev/null +++ b/0008-mkfs-fix-the-issue-of-maxpct-set-to-0-not-taking-eff.patch @@ -0,0 +1,51 @@ +From a1f05a461579595965148245746ae3dfc4adf6f0 Mon Sep 17 00:00:00 2001 +From: liuh +Date: Tue, 30 Sep 2025 16:52:00 +0800 +Subject: [PATCH] mkfs: fix the issue of maxpct set to 0 not taking effect + +--- + mkfs/xfs_mkfs.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c +index 4c8a6f3..75f682f 100644 +--- a/mkfs/xfs_mkfs.c ++++ b/mkfs/xfs_mkfs.c +@@ -893,12 +893,12 @@ struct cli_params { + int lsunit; + int is_supported; + int proto_slashes_are_spaces; ++ int imaxpct; + + /* parameters where 0 is not a valid value */ + int64_t agcount; + int inodesize; + int inopblock; +- int imaxpct; + int lsectorsize; + uuid_t uuid; + +@@ -3186,9 +3186,10 @@ calculate_imaxpct( + struct mkfs_params *cfg, + struct cli_params *cli) + { +- cfg->imaxpct = cli->imaxpct; +- if (cfg->imaxpct) ++ if (cli->imaxpct >= 0) { ++ cfg->imaxpct = cli->imaxpct; + return; ++ } + + /* + * This returns the % of the disk space that is used for +@@ -4075,6 +4076,7 @@ main( + .xi = &xi, + .loginternal = 1, + .is_supported = 1, ++ .imaxpct = -1, /* set sb_imax_pct automatically */ + }; + struct mkfs_params cfg = {}; + +-- +2.43.0 + diff --git a/xfsprogs.spec b/xfsprogs.spec index 08402fa..d5de225 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -1,6 +1,6 @@ Name: xfsprogs Version: 6.6.0 -Release: 8 +Release: 9 Summary: Administration and debugging tools for the XFS file system License: GPL+ and LGPLv2+ URL: https://xfs.wiki.kernel.org @@ -109,6 +109,9 @@ rm -rf %{buildroot}%{_datadir}/doc/xfsprogs/ %changelog +* Tue Sep 30 2025 liuh - 6.6.0-9 +- mkfs: fix the issue of maxpct set to 0 not taking effect + * Tue Jul 1 2025 wangmian - 6.6.0-8 - Fixed bug for macros in Changelog -- Gitee