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 0/5] Add option to use default config file.
Date: Mon, 1 Jun 2026 21:55:54 -0700 [thread overview]
Message-ID: <20260602045554.GT6078@frogsfrogsfrogs> (raw)
In-Reply-To: <58a188ce948dc7b02da9175ba97e8297@herbolt.com>
On Fri, May 29, 2026 at 08:01:55PM +0200, Lukas Herbolt wrote:
> On 2026-05-28 07:10, Darrick J. Wong wrote:
> > On Mon, May 25, 2026 at 09:57:47AM +0200, Lukas Herbolt wrote:
> > > Hi,
> > > Sending a v2 version trying to implement the changes suggested by
> > > Carlos, Darrick, Eric and Dave. The default.conf is not installed
> > > automatically but there is simple example file.
> > >
> > > The order is now build-time < default-file < command line settings.
> > > Some values like uuid,sunit,swidth sector size and block size are not
> > > allowed to be set in the default config file and if set user is warned
> > > about it and the value is reset to build-time default.
> > >
> > > I moved setting of some values in cli_params and setting of
> > > mkfs_default_params
> > > into new bld_dft struct as If I get it correctly we were basically
> > > setting
> > > some of the default values on two places. It also resulted in
> > > cleanup of
> > > unused parameters from some validate_* functions.
> >
> > This looks mostly good, but I have a couple of suggestions to improve
> > the ergonomics for distributors:
> >
> > 1. Make it so that mkfs.xfs itself can spit out a configuration file
> > based on the "bld_dft" object. Then we can always generate the
> > "default.conf" file with something as simple as:
> >
> > $ mkfs.xfs --write-defaults /root/my.conf
> > $ cat /root/my.conf
> > [metadata]
> > rmapbt=1
> > ...
> >
> > Obviously this requires some careful thought about what exactly the
> > printing function will actually emit -- my guess is that the only things
> > worth printing are filesystem features and the default fsxattr values
> > that get written into the rootdir, since the device geometry will
> > change.
>
> Make sense, but I would then remove the example file, also this comes to the
> fact while some (HW geometry) stuff are ignored in the default file. I would
> not allow user to set sector size sunit/swidth from the default file. The
> question
> is should we just exit with some info and calling usage() or set it to
> default
> and warn about it?
AFAICT, the config file parser currently allows you to provide fs
geometry options (e.g. sunit) in the config file. I think we should
continue adding /any/ option that came from a config file, because if
that makes for an invalid geometry then mkfs will just complain about it
and error out.
But I wouldn't have a program that generates a config file capture
geometry information, at least not without a special switch (e.g.
--capture-exact-config).
> > 2. Make xfs_db/xfs_info emit a similar configuration file based on an
> > existing filesystem. Anyone needing to create many feature-for-feature
> > replicas of an existing filesystem will now have a much easier time than
> > encoding options into a shell script.
> >
> > # xfs_info -c 'writecfg' /my/rad/fs > /root/rad.conf
> > # mkfs.xfs -c options=/root/rad.conf /dev/sda
> > # mkfs.xfs -c options=/root/rad.conf /dev/sdb
> > ...
> >
> > (maybe add an xfs_admin option to call xfs_{db,info} too?)
> >
> > What do you think?
> >
>
> I guess xfs_{db,info} option which would be used in xfs_admin makes sense.
> But again here comes a question should we emit exact copy or leave HW
> geometry aside?
I'd only write out user-visible filesystem features since (at least in
our experience at $employer) customers usually require either specific
features or compatibility with an older kernel.
If someone really wants hw geometry then we can add that later. ;)
--D
prev parent reply other threads:[~2026-06-02 4:55 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
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 [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=20260602045554.GT6078@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