Re: [PATCH] Improve information about logbsize valid values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 26, 2025 at 02:23:12PM +0200, cem@xxxxxxxxxx wrote:
> From: Carlos Maiolino <cem@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxx>

--D

>  .TP
>  .BR logdev=device " and " rtdev=device
>  Use an external log (metadata journal) and/or real-time device.
> -- 
> 2.51.0
> 
> 




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux