From: Manognya Singuru <msinguru@redhat.com>
To: linux-xfs@vger.kernel.org
Cc: aalbersh@redhat.com, Manognya Singuru <msinguru@redhat.com>
Subject: [PATCH] mkfs: fix filesystem and log size units
Date: Thu, 18 Jun 2026 20:11:11 +0530 [thread overview]
Message-ID: <20260618144111.178311-1-msinguru@redhat.com> (raw)
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>
---
man/man8/mkfs.xfs.8.in | 6 +++---
mkfs/xfs_mkfs.c | 14 +++++++-------
2 files changed, 10 insertions(+), 10 deletions(-)
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();
}
--
2.54.0
next reply other threads:[~2026-06-18 14:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 14:41 Manognya Singuru [this message]
2026-06-22 10:39 ` [PATCH] mkfs: fix filesystem and log size units Carlos Maiolino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260618144111.178311-1-msinguru@redhat.com \
--to=msinguru@redhat.com \
--cc=aalbersh@redhat.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox