linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 0/5] mkfs: Configuration file defined options
Date: Wed, 14 Oct 2020 22:39:16 -0700	[thread overview]
Message-ID: <20201015053916.GQ9832@magnolia> (raw)
In-Reply-To: <20201015053234.GE7391@dread.disaster.area>

On Thu, Oct 15, 2020 at 04:32:34PM +1100, Dave Chinner wrote:
> On Wed, Oct 14, 2020 at 10:13:00PM -0700, Darrick J. Wong wrote:
> > On Thu, Oct 15, 2020 at 02:29:20PM +1100, Dave Chinner wrote:
> > > Version 2:
> > > 
> > > - "-c file=xxx" > "-c options=xxx"
> > > - split out constification into new patch
> > > - removed debug output
> > > - fixed some comments
> > > - added man page stuff
> > > 
> > > Hi Folks,
> > > 
> > > Because needing config files for mkfs came up yet again in
> > > discussion, here is a simple implementation of INI format config
> > > files. These config files behave identically to options specified on
> > > the command line - the do not change defaults, they do not override
> > > CLI options, they are not overridden by cli options.
> > > 
> > > Example:
> > > 
> > > $ echo -e "[metadata]\ncrc = 0" > foo
> > > $ mkfs/mkfs.xfs -N -c options=foo -d file=1,size=100m blah
> > > Parameters parsed from config file foo successfully
> > > meta-data=blah                   isize=256    agcount=4, agsize=6400 blks
> > >          =                       sectsz=512   attr=2, projid32bit=1
> > >          =                       crc=0        finobt=0, sparse=0, rmapbt=0
> > >          =                       reflink=0
> > > data     =                       bsize=4096   blocks=25600, imaxpct=25
> > >          =                       sunit=0      swidth=0 blks
> > > naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
> > > log      =internal log           bsize=4096   blocks=853, version=2
> > >          =                       sectsz=512   sunit=0 blks, lazy-count=1
> > > realtime =none                   extsz=4096   blocks=0, rtextents=0
> > > $
> > > 
> > > And there's a V4 filesystem as specified by the option defined
> > > in the config file. If we do:
> > > 
> > > $ mkfs/mkfs.xfs -N -c options=foo -m crc=1 -d file=1,size=100m blah
> > > -m crc option respecified
> > > Usage: mkfs.xfs
> > > .....
> > > $
> > > 
> > > You can see it errors out because the CRC option was specified in
> > > both the config file and on the CLI.
> > > 
> > > There's lots of stuff we can do to make the conflict and respec
> > > error messages better, but that doesn't change the basic
> > > functionality of config file based mkfs options. To allow for future
> > > changes to the way we want to apply config files, I created a
> > > full option subtype for config files. That means we can add another
> > > option to say "apply config file as default values rather than as
> > > options" if we decide that is functionality that we want to support.
> > > 
> > > However, policy decisions like that are completely separate to the
> > > mechanism, so these patches don't try to address desires to ship
> > > "tuned" configs, system wide option files, shipping distro specific
> > > defaults in config files, etc. This is purely a mechanism to allow
> > > users to specify options via files instead of on the CLI.  No more,
> > > no less.
> > > 
> > > This has only been given a basic smoke testing right now (see above!
> > > :).  I need to get Darrick's tests from the previous round of config
> > 
> > This was in the v1 series; have you gotten Darrick's fstests to do more
> > substantial testing? ;)
> 
> I got as far as asking you "where did you get your INI format
> specification from?" because the tests assume stuff that I don't
> think is valid about whitespace and comment structure in the format.
> And then I disappeared down a rathole of "there is no one true
> specification for INI files" and then something else came up....
> 
> I have not got back to culling the whitespace craziness from those
> tests yet. The only format I'm considering supporting is what the
> library itself actually supports, and that means random whitespace
> in names, values and section headers will be a bad configuration
> file format error.

Yeah.  The ini format craziness was a direct result of me trying to
(re)interpret the format based on the line formats that the previous
round of patches coded into mkfs.  Perhaps the only parts easily
salvageable are the ones that actually test the config file options
themselves...

--D

> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com

      reply	other threads:[~2020-10-15  5:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15  3:29 [PATCH 0/5] mkfs: Configuration file defined options Dave Chinner
2020-10-15  3:29 ` [PATCH 1/5] build: add support for libinih for mkfs Dave Chinner
2020-10-15  5:40   ` Darrick J. Wong
2020-10-15  3:29 ` [PATCH 2/5] mkfs: add initial ini format config file parsing support Dave Chinner
2020-10-15  5:46   ` Darrick J. Wong
2020-10-15  6:09     ` Dave Chinner
2020-10-15  3:29 ` [PATCH 3/5] mkfs: constify various strings Dave Chinner
2020-10-15  5:31   ` Darrick J. Wong
2020-10-15  3:29 ` [PATCH 4/5] mkfs: hook up suboption parsing to ini files Dave Chinner
2020-10-15  5:24   ` Darrick J. Wong
2020-10-15  3:29 ` [PATCH 5/5] mkfs: document config files in mkfs.xfs(8) Dave Chinner
2020-10-15  5:36   ` Darrick J. Wong
2020-10-15  5:13 ` [PATCH 0/5] mkfs: Configuration file defined options Darrick J. Wong
2020-10-15  5:32   ` Dave Chinner
2020-10-15  5:39     ` 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=20201015053916.GQ9832@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    /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).