Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Lukas Herbolt <lukas@herbolt.com>,
	sandeen@sandeen.net, aalbersh@kernel.org,
	linux-xfs@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>
Subject: Re: [RFC PATCH] mkfs: allow specification of default options via configuration file
Date: Tue, 19 May 2026 01:43:28 -0700	[thread overview]
Message-ID: <agwisMUPPeYa5qDM@infradead.org> (raw)
In-Reply-To: <20260514150653.GW9555@frogsfrogsfrogs>

On Thu, May 14, 2026 at 08:06:53AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Ted asked for the ability to set default mkfs options, but to retain the
> ability respecify options via a separate configuration file or cli
> options.  This would be useful for running fstests with the default
> featureset of (say) Linux 5.15 LTS, while still allowing individual
> testcases to provide their own overrides.  It's certainly less messy
> than what Ted does today, which is a bash script that copies the desired
> config file and changes things.

Looks reasonable, do you have a test for it as well?

> +static inline int
> +getopt_mkfs(

I don't think there's much of a point in the inline here.

> +	int			argc,
> +	char *const		argv[],
> +	const struct option	*longopts,
> +	int			*longindex)
> +{
> +	return getopt_long(argc, argv, "b:c:d:i:l:L:m:n:KNp:qr:s:CfV",
> +			longopts, longindex);
> +}

Why does this hardcode the short options, but requires the caller to
pass in the long options (which are the same for both callers)?

> +	while ((c = getopt_mkfs(argc, argv, long_options, &option_index)) != EOF) {

Killing the long_opts would also avoid the overly long line here and in
the other call site.

> +		if (c == 'c') {
> +			parse_subopts(c, optarg, defcfg_subopt_tab, &cli);
> +		}

Spurious braces.


  reply	other threads:[~2026-05-19  8:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14 15:06 [RFC PATCH] mkfs: allow specification of default options via configuration file Darrick J. Wong
2026-05-19  8:43 ` Christoph Hellwig [this message]
2026-05-19 14:10   ` 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=agwisMUPPeYa5qDM@infradead.org \
    --to=hch@infradead.org \
    --cc=aalbersh@kernel.org \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=lukas@herbolt.com \
    --cc=sandeen@sandeen.net \
    --cc=tytso@mit.edu \
    /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