]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs: improve the error message in adjust_nr_zones
authorChristoph Hellwig <hch@lst.de>
Wed, 22 Oct 2025 08:52:05 +0000 (10:52 +0200)
committerAndrey Albershteyn <aalbersh@kernel.org>
Fri, 7 Nov 2025 12:16:58 +0000 (13:16 +0100)
Print the zone counts to help the user to understand the problem.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
mkfs/xfs_mkfs.c

index e66f71b903ebf7e3a8478e224987bacb69e0d01b..cb7c20e3aa18f02534bb2df52d818c45fd10b090 100644 (file)
@@ -4552,11 +4552,11 @@ adjust_nr_zones(
        if (!cli->rgcount)
                cfg->rgcount += XFS_RESERVED_ZONES;
        if (cfg->rgcount > max_zones) {
-               cfg->rgcount = max_zones;
                fprintf(stderr,
-_("Warning: not enough zones for backing requested rt size due to\n"
+_("Warning: not enough zones (%lu/%u) for backing requested rt size due to\n"
   "over-provisioning needs, writable size will be less than %s\n"),
-                       cli->rtsize);
+                       cfg->rgcount, max_zones, cli->rtsize);
+               cfg->rgcount = max_zones;
        }
        new_rtblocks = (cfg->rgcount * cfg->rgsize);
        slack = (new_rtblocks - cfg->rtblocks) % cfg->rgsize;