From: "Darrick J. Wong" <djwong@kernel.org>
To: Lukas Herbolt <lukas@herbolt.com>
Cc: sandeen@sandeen.net, aalbersh@kernel.org, dgc@kernel.org,
linux-xfs@vger.kernel.org
Subject: Re: [RFC PATCH v2 5/5] xfsprogs: mkfs.xfs clean up unused dft option in various validators
Date: Wed, 27 May 2026 22:01:43 -0700 [thread overview]
Message-ID: <20260528050143.GG6078@frogsfrogsfrogs> (raw)
In-Reply-To: <20260525075752.4159504-6-lukas@herbolt.com>
On Mon, May 25, 2026 at 09:57:52AM +0200, Lukas Herbolt wrote:
> The struct cli_params dft was only used in validate_blocksize().
> Now the cli.blocksize is always set either over bld_dflt or
> file_dflt or from command line/config file. All the other functions
> are not accessing the dft in their body.
>
> Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
I wish this had come first, but oh well whatever.
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> mkfs/xfs_mkfs.c | 24 +++++++++++-------------
> 1 file changed, 11 insertions(+), 13 deletions(-)
>
> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> index cb9c528021d6..5d1d27235a72 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -2392,7 +2392,6 @@ static void
> validate_sectorsize(
> struct mkfs_params *cfg,
> struct cli_params *cli,
> - struct cli_params *dft,
> struct fs_topology *ft,
> int dry_run,
> int force_overwrite)
> @@ -2481,18 +2480,19 @@ _("block size %d cannot be smaller than sector size %d\n"),
> static void
> validate_blocksize(
> struct mkfs_params *cfg,
> - struct cli_params *cli,
> - struct cli_params *dft)
> + struct cli_params *cli)
> {
> /*
> * Blocksize and sectorsize first, other things depend on them
> * For RAID4/5/6 we want to align sector size and block size,
> * so we need to start with the device geometry extraction too.
> + *
> + * The cli->blocksize size is already set from the bld_dflt
> + * or from file_dflt or via command line. We just need to check
> + * if the value is within our limits.
> */
> - if (!cli->blocksize)
> - cfg->blocksize = dft->blocksize;
> - else
> - cfg->blocksize = cli->blocksize;
> +
> + cfg->blocksize = cli->blocksize;
> cfg->blocklog = libxfs_highbit32(cfg->blocksize);
>
> /* validate block sizes are in range */
> @@ -2522,7 +2522,6 @@ static void
> validate_log_sectorsize(
> struct mkfs_params *cfg,
> struct cli_params *cli,
> - struct cli_params *dft,
> struct fs_topology *ft)
> {
>
> @@ -2714,7 +2713,6 @@ static void
> validate_zoned(
> struct mkfs_params *cfg,
> struct cli_params *cli,
> - struct cli_params *dft,
> struct zone_topology *zt)
> {
> if (!cli->xi->data.isfile) {
> @@ -6163,8 +6161,8 @@ main(
> * Extract as much of the valid config as we can from the CLI input
> * before opening the libxfs devices.
> */
> - validate_blocksize(&cfg, &cli, &bld_dft);
> - validate_sectorsize(&cfg, &cli, &bld_dft, &ft, dry_run, force_overwrite);
> + validate_blocksize(&cfg, &cli);
> + validate_sectorsize(&cfg, &cli, &ft, dry_run, force_overwrite);
>
> /*
> * XXX: we still need to set block size and sector size global variables
> @@ -6173,8 +6171,8 @@ main(
> blocksize = cfg.blocksize;
> sectorsize = cfg.sectorsize;
>
> - validate_log_sectorsize(&cfg, &cli, &bld_dft, &ft);
> - validate_zoned(&cfg, &cli, &bld_dft, &zt);
> + validate_log_sectorsize(&cfg, &cli, &ft);
> + validate_zoned(&cfg, &cli, &zt);
> validate_sb_features(&cfg, &cli);
>
> /*
> --
> 2.54.0
>
>
next prev parent reply other threads:[~2026-05-28 5:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-25 7:57 [RFC PATCH v2 0/5] Add option to use default config file Lukas Herbolt
2026-05-25 7:57 ` [RFC PATCH v2 1/5] xfsprogs: mkfs.xfs Add buildtime default cli_params as global variable Lukas Herbolt
2026-05-28 4:50 ` Darrick J. Wong
2026-05-29 18:02 ` Lukas Herbolt
2026-05-25 7:57 ` [RFC PATCH v2 2/5] xfsprogs: mkfs.xfs add default configuration file Lukas Herbolt
2026-05-28 4:56 ` Darrick J. Wong
2026-05-29 18:06 ` Lukas Herbolt
2026-05-25 7:57 ` [RFC PATCH v2 3/5] xfsprogs: mkfs.xfs add auto|autodetect value for -d/l/r concurrency Lukas Herbolt
2026-05-28 4:57 ` Darrick J. Wong
2026-05-29 18:07 ` Lukas Herbolt
2026-05-25 7:57 ` [RFC PATCH v2 4/5] xfs_admin: add -d option to manage default mkfs config file Lukas Herbolt
2026-05-28 5:00 ` Darrick J. Wong
2026-05-25 7:57 ` [RFC PATCH v2 5/5] xfsprogs: mkfs.xfs clean up unused dft option in various validators Lukas Herbolt
2026-05-28 5:01 ` Darrick J. Wong [this message]
2026-05-28 5:10 ` [RFC PATCH v2 0/5] Add option to use default config file Darrick J. Wong
2026-05-29 18:01 ` Lukas Herbolt
2026-06-02 4:55 ` Darrick J. Wong
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=20260528050143.GG6078@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=aalbersh@kernel.org \
--cc=dgc@kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=lukas@herbolt.com \
--cc=sandeen@sandeen.net \
/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