From: Manognya Singuru Date: Thu, 18 Jun 2026 14:41:11 +0000 (+0530) Subject: mkfs: fix filesystem and log size units X-Git-Tag: v7.1.0~38 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ec7424231d53b730149b4c49c16af37e7288f002;p=xfsprogs-dev.git mkfs: fix filesystem and log size units 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 Reviewed-by: Carlos Maiolino --- diff --git a/man/man8/mkfs.xfs.8.in b/man/man8/mkfs.xfs.8.in index fbafc5c7..c4dee4fe 100644 --- a/man/man8/mkfs.xfs.8.in +++ b/man/man8/mkfs.xfs.8.in @@ -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, diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index dd8a48c3..cbc703cc 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -25,10 +25,10 @@ #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(); }