Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.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 07:10:37 -0700	[thread overview]
Message-ID: <20260519141037.GG9555@frogsfrogsfrogs> (raw)
In-Reply-To: <agwisMUPPeYa5qDM@infradead.org>

On Tue, May 19, 2026 at 01:43:28AM -0700, Christoph Hellwig wrote:
> 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?

Somewhere, yeah :)

> > +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)?

long_options is a local variable which contains a pointer into cli,
which is another local variable in main().

I could have made a fugly macro with implicit variable access, but that
was yuck.

> > +	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.

I could just shorten it to "lopts" or something.

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

Will fix.

--D

      reply	other threads:[~2026-05-19 14:10 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
2026-05-19 14:10   ` Darrick J. Wong [this message]

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=20260519141037.GG9555@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=aalbersh@kernel.org \
    --cc=hch@infradead.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