Linux XFS filesystem development
 help / color / mirror / Atom feed
From: cem@kernel.org
To: aalbersh@redhat.com
Cc: david@fromorbit.com, djwong@kernel.org, linux-xfs@vger.kernel.org
Subject: [PATCH] Improve information about logbsize valid values
Date: Tue, 26 Aug 2025 14:23:12 +0200	[thread overview]
Message-ID: <20250826122320.237816-1-cem@kernel.org> (raw)

From: Carlos Maiolino <cem@kernel.org>

Valid values for logbsize depends on whether log_sunit is set
on the filesystem or not and if logbsize is manually set or not.

When manually set, logbsize must be one of the speficied values -
32k to 256k inclusive in power-of-to increments. And, the specified
value must also be a multiple of log_sunit.

The default configuration for v2 logs uses a relaxed restriction,
setting logbsize to log_sunit, independent if it is one of the valid
values or not - also implicitly ignoring the power of two restriction.

Instead of changing valid possible values for logbsize, increasing the
testing matrix and allowing users to use some dubious configuration,
just update the man page to describe this difference in behavior when
manually setting logbsize or leave it to defaults.

This has originally been found by an user attempting to manually set
logbsize to the same value picked by the default configuration just so
to receive an error message as result.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
---
 man/man5/xfs.5 | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/man/man5/xfs.5 b/man/man5/xfs.5
index f9c046d4721a..b2069d17b0fe 100644
--- a/man/man5/xfs.5
+++ b/man/man5/xfs.5
@@ -246,16 +246,18 @@ controls the size of each buffer and so is also relevant to
 this case.
 .TP
 .B logbsize=value
-Set the size of each in-memory log buffer.  The size may be
+Set the size of each in-memory log buffer. The size may be
 specified in bytes, or in kibibytes (KiB) with a "k" suffix.
+If set manually, logbsize must be one of the specified valid
+sizes and a multiple of the log stripe unit - configured at mkfs time.
+.sp
 Valid sizes for version 1 and version 2 logs are 16384 (value=16k)
 and 32768 (value=32k).  Valid sizes for version 2 logs also
-include 65536 (value=64k), 131072 (value=128k) and 262144 (value=256k). The
-logbsize must be an integer multiple of the log
-stripe unit configured at mkfs time.
+include 65536 (value=64k), 131072 (value=128k) and 262144 (value=256k).
 .sp
 The default value for version 1 logs is 32768, while the
-default value for version 2 logs is max(32768, log_sunit).
+default value for version 2 logs is max(32768, log_sunit) even if
+log_sunit does not match one of the valid values above.
 .TP
 .BR logdev=device " and " rtdev=device
 Use an external log (metadata journal) and/or real-time device.
-- 
2.51.0


             reply	other threads:[~2025-08-26 12:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-26 12:23 cem [this message]
2025-08-26 14:54 ` [PATCH] Improve information about logbsize valid values Darrick J. Wong
2025-09-02 11:24   ` 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=20250826122320.237816-1-cem@kernel.org \
    --to=cem@kernel.org \
    --cc=aalbersh@redhat.com \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --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