]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
mkfs: fix filesystem and log size units
authorManognya Singuru <msinguru@redhat.com>
Thu, 18 Jun 2026 14:41:11 +0000 (20:11 +0530)
committerAndrey Albershteyn <aalbersh@kernel.org>
Tue, 23 Jun 2026 09:04:31 +0000 (11:04 +0200)
The actual thresholds enforced by mkfs are in MiB and GiB but the
error messages and documentation report the limits as MB and GB.

Update the filesystem and log size threshold messages, comments,
and man page to use MiB and GiB.

Signed-off-by: Manognya Singuru <msinguru@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
man/man8/mkfs.xfs.8.in
mkfs/xfs_mkfs.c

index fbafc5c79e02debad52d8fa621d753e1fade36f9..c4dee4fe07ae839a23f3f08ece0c8f53a66a2e41 100644 (file)
@@ -463,7 +463,7 @@ is required if
 is given. Otherwise, it is only needed if the filesystem should occupy
 less space than the size of the special file.
 
-The data section must be at least 300MB in size.
+The data section must be at least 300MiB in size.
 .TP
 .BI sunit= value
 This is used to specify the stripe unit for a RAID device or a
@@ -805,8 +805,8 @@ described above. The overriding minimum value for size is 512 blocks.
 With some combinations of filesystem block size, inode size,
 and directory block size, the minimum log size is larger than 512 blocks.
 
-The log must be at least 64MB in size.
-The log cannot be more than 2GB in size.
+The log must be at least 64MiB in size.
+The log cannot be more than 2GiB in size.
 .TP
 .BI version= value
 This specifies the version of the log. The current default is 2,
index dd8a48c3633ef098150d1c8e427e809989923ffc..cbc703cc5c32a371909bad88156d6a7d77718d90 100644 (file)
 #define MEGABLOCKS(count, blog)        ((uint64_t)(count) << (20 - (blog)))
 
 /*
- * Realistically, the log should never be smaller than 64MB.  Studies by the
+ * Realistically, the log should never be smaller than 64MiB.  Studies by the
  * kernel maintainer in early 2022 have shown a dramatic reduction in long tail
  * latency of the xlog grant head waitqueue when running a heavy metadata
- * update workload when the log size is at least 64MB.
+ * update workload when the log size is at least 64MiB.
  */
 #define XFS_MIN_REALISTIC_LOG_BLOCKS(blog)     (MEGABLOCKS(64, (blog)))
 
@@ -3435,19 +3435,19 @@ validate_supported(
                return;
 
        /*
-        * We don't support filesystems smaller than 300MB anymore.  Tiny
+        * We don't support filesystems smaller than 300MiB anymore.  Tiny
         * filesystems have never been XFS' design target.  This limit has been
         * carefully calculated to prevent formatting with a log smaller than
         * the "realistic" size.
         *
-        * If the realistic log size is 64MB, there are four AGs, and the log
+        * If the realistic log size is 64MiB, there are four AGs, and the log
         * AG should be at least 1/8 free after formatting, this gives us:
         *
-        * 64MB * (8 / 7) * 4 = 293MB
+        * 64MiB * (8 / 7) * 4 = 293MiB
         */
        if (mp->m_sb.sb_dblocks < MEGABLOCKS(300, mp->m_sb.sb_blocklog)) {
                fprintf(stderr,
- _("Filesystem must be larger than 300MB.\n"));
+ _("Filesystem must be larger than 300MiB.\n"));
                usage();
        }
 
@@ -3458,7 +3458,7 @@ validate_supported(
        if (mp->m_sb.sb_logblocks <
                        XFS_MIN_REALISTIC_LOG_BLOCKS(mp->m_sb.sb_blocklog)) {
                fprintf(stderr,
- _("Log size must be at least 64MB.\n"));
+ _("Log size must be at least 64MiB.\n"));
                usage();
        }