* [PATCH] Improve information about logbsize valid values
@ 2025-08-26 12:23 cem
2025-08-26 14:54 ` Darrick J. Wong
0 siblings, 1 reply; 3+ messages in thread
From: cem @ 2025-08-26 12:23 UTC (permalink / raw)
To: aalbersh; +Cc: david, djwong, linux-xfs
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Improve information about logbsize valid values
2025-08-26 12:23 [PATCH] Improve information about logbsize valid values cem
@ 2025-08-26 14:54 ` Darrick J. Wong
2025-09-02 11:24 ` Carlos Maiolino
0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2025-08-26 14:54 UTC (permalink / raw)
To: cem; +Cc: aalbersh, david, linux-xfs
On Tue, Aug 26, 2025 at 02:23:12PM +0200, cem@kernel.org wrote:
> 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.
Weird, but as a documentation stopgap until someone figures out if
there are any bad effects of non-power-of-2 logbsizes,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> .TP
> .BR logdev=device " and " rtdev=device
> Use an external log (metadata journal) and/or real-time device.
> --
> 2.51.0
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Improve information about logbsize valid values
2025-08-26 14:54 ` Darrick J. Wong
@ 2025-09-02 11:24 ` Carlos Maiolino
0 siblings, 0 replies; 3+ messages in thread
From: Carlos Maiolino @ 2025-09-02 11:24 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: aalbersh, david, linux-xfs
On Tue, Aug 26, 2025 at 07:54:42AM -0700, Darrick J. Wong wrote:
> On Tue, Aug 26, 2025 at 02:23:12PM +0200, cem@kernel.org wrote:
> > 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.
>
> Weird, but as a documentation stopgap until someone figures out if
> there are any bad effects of non-power-of-2 logbsizes,
> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
My point indeed :)
>
> --D
>
> > .TP
> > .BR logdev=device " and " rtdev=device
> > Use an external log (metadata journal) and/or real-time device.
> > --
> > 2.51.0
> >
> >
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-02 11:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-26 12:23 [PATCH] Improve information about logbsize valid values cem
2025-08-26 14:54 ` Darrick J. Wong
2025-09-02 11:24 ` Carlos Maiolino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox