From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>,
linux-xfs@vger.kernel.org, jack@suse.com, jeffm@suse.com,
okurz@suse.com, lpechacek@suse.com, Jan Tulak <jtulak@redhat.com>
Subject: Re: [PATCH 0/9] mkfs.xfs: add mkfs.xfs.conf support
Date: Thu, 9 Mar 2017 18:57:51 +0100 [thread overview]
Message-ID: <20170309175750.GE14437@wotan.suse.de> (raw)
In-Reply-To: <ac91cbba-83b7-31d4-0fc9-cdb52286acdf@sandeen.net>
On Wed, Mar 08, 2017 at 10:41:52PM -0600, Eric Sandeen wrote:
>
> On 3/8/17 6:51 PM, Luis R. Rodriguez wrote:
> > On Wed, Mar 08, 2017 at 06:16:57PM -0600, Eric Sandeen wrote:
> >> On 3/3/17 5:13 PM, Luis R. Rodriguez wrote:
> >>> This series adds mkfs.xfs.conf support, so that options can now be
> >>> shoved into a configuration file. This enables certain defaults to be
> >>> saved for folks sticking to certain values, but more importantly it
> >>> also enables distributions to override certain defaults so that new
> >>> filesystems remain compatible with older distributions.
> >>>
> >>> This has been based on top of xfsprogs-dev v4.9.0-rc1.
> >>>
> >>> Given we already have an existinsg infrastructure to validate argument
> >>> values this reuses that infrastructure by first adding helpers and porting
> >>> over the argument parsing suppor to use these helpers.
> >>
> >> Hm, one functional problem with this, aside from Dave's concerns and
> >> suggestions, is that many options in the config file can't actually
> >> be overridden on the commandline because they are treated as having
> >> been respecified, which is not allowed:
> >>
> >> # mkfs.xfs -m crc=1 -m crc=0 -f fsfile
> >> -m crc option respecified
> >> Usage: mkfs.xfs
> >
> > This was dealt by enabling the last option taken to override, and
> > this mechanism was also taken to enable the config file to take
> > the first value but let the command line to override. Refer to
> > usage of reset_opt(). Granted I had only done this on B_LOG but
> > this can easily be made to enable us to reset for all options.
>
> Well, the above test was with your full patchset applied,
> so my point is that it's not currently working properly as posted...
Sorry yes I failed to reset_opt() for each config entry on the config
file. I had meant to move reset_opt() generically on parse_subopts()
so that "last entry specified wins" always. I had only added this
for B_LOG.
> But are you proposing adding this reset_opt() to /every/ option?
> That would undo all of the respecification checks, which were
> put there for a reason (I assume?) ;) I don't really remember
> how all of the respecification and compatibility checking works
> tbh, I'd have to dig back into it. Maybe jtulak can help...
>
> But it makes little sense to have a framework to prevent
> respecification but then render it useless with reset_opt()
> after each option gets parsed. Or do I misunderstand?
I used reset_opt() and went with "last entry specified wins". From my
review the goal of the respecification was to ensure each opt param
parsed would not reset a prior set param, a paranoid measure, however
this clearly does not work well if we want to allow for "last entry
specified wins", or re-use the validators for a config file parsing
for a first shot a parsing entries.
*Proper validation* is and should be done *after* all parameters are
set, and it sounds like jtulak's work helps shove this into helpers
*as should be done* to clear cruft out of main(). Having these params
in structs should help both efforts.
> > If we don't want to enable subsequent command line entries to
> > override (to keep old behaviour) but still allow at least the
> > command line to override the config file options, that's also
> > doable.
>
> Well, I'm going to need to refamiliarize myself with how the
> conflict checking works, and why respecification is prohibited.
> If respecification matters, it matters just as much whether the
> first specification came from the config file or from the command
> line.
Agreed. The above is what I concluded based on my inspection of the
code. It would be of course great to get more eyeballs on it.
Luis
next prev parent reply other threads:[~2017-03-09 17:57 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 23:13 [PATCH 0/9] mkfs.xfs: add mkfs.xfs.conf support Luis R. Rodriguez
2017-03-03 23:13 ` [PATCH 1/9] mkfs.xfs: add helper to parse command line options Luis R. Rodriguez
2017-03-03 23:13 ` [PATCH 2/9] mkfs.xfs: move dopts to struct mkfs_xfs_opts Luis R. Rodriguez
2017-03-03 23:13 ` [PATCH 3/9] mkfs.xfs: move iopts to " Luis R. Rodriguez
2017-03-03 23:13 ` [PATCH 4/9] mkfs.xfs: move lopts " Luis R. Rodriguez
2017-03-03 23:13 ` [PATCH 5/9] mkfs.xfs: move mopts " Luis R. Rodriguez
2017-03-03 23:13 ` [PATCH 6/9] mkfs.xfs: move nopts " Luis R. Rodriguez
2017-03-03 23:13 ` [PATCH 7/9] mkfs.xfs: move ropts " Luis R. Rodriguez
2017-03-03 23:13 ` [PATCH 8/9] mkfs.xfs: use parse_subopts() to parse sopts Luis R. Rodriguez
2017-03-03 23:13 ` [PATCH 9/9] mkfs.xfs: add mkfs.xfs.conf parse support Luis R. Rodriguez
2017-03-03 23:55 ` Dave Chinner
2017-03-09 5:38 ` Eric Sandeen
2017-03-03 23:24 ` [PATCH 0/9] mkfs.xfs: add mkfs.xfs.conf support Luis R. Rodriguez
2017-03-04 3:49 ` Eric Sandeen
2017-03-04 4:56 ` Dave Chinner
2017-03-06 0:08 ` Eric Sandeen
2017-03-07 20:07 ` Jeff Mahoney
2017-03-07 20:09 ` Eric Sandeen
2017-03-06 8:50 ` Jan Kara
2017-03-09 0:16 ` Eric Sandeen
2017-03-09 0:51 ` Luis R. Rodriguez
2017-03-09 4:41 ` Eric Sandeen
2017-03-09 10:12 ` Jan Tulak
2017-03-09 14:31 ` Eric Sandeen
2017-03-09 15:21 ` Jan Tulak
2017-03-09 17:57 ` Luis R. Rodriguez [this message]
2017-03-09 22:34 ` Dave Chinner
2017-04-24 5:00 ` Luis R. Rodriguez
2017-04-24 7:26 ` Jan Tulak
2017-04-24 8:25 ` Luis R. Rodriguez
2017-05-11 22:46 ` Luis R. Rodriguez
2017-05-11 22:57 ` Eric Sandeen
2017-05-11 23:08 ` Luis R. Rodriguez
2017-05-12 0:48 ` Darrick J. Wong
2017-05-12 16:05 ` Eric Sandeen
2017-05-12 17:03 ` Luis R. Rodriguez
2017-05-12 17:05 ` Jeff Mahoney
2017-05-12 17:30 ` Luis R. Rodriguez
2017-05-11 23:00 ` Darrick J. Wong
2017-05-11 23:19 ` Luis R. Rodriguez
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=20170309175750.GE14437@wotan.suse.de \
--to=mcgrof@kernel.org \
--cc=jack@suse.com \
--cc=jeffm@suse.com \
--cc=jtulak@redhat.com \
--cc=linux-xfs@vger.kernel.org \
--cc=lpechacek@suse.com \
--cc=okurz@suse.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;
as well as URLs for NNTP newsgroup(s).