All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Andrey Albershteyn <aalbersh@kernel.org>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/5] mkfs: print config file for a given mkfs configuration
Date: Thu, 3 Sep 2026 14:49:09 -0700	[thread overview]
Message-ID: <20260903214909.GW1933798@frogsfrogsfrogs> (raw)
In-Reply-To: <aplVuRd-qsqVFW0Q@aalbersh-thinkpadx1carbongen13.rmtcz.csb>

On Thu, Sep 03, 2026 at 01:14:01PM +0200, Andrey Albershteyn wrote:
> On 2026-08-31 16:27:05, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > Add a -c makecfg= switch to mkfs to emit a mkfs.xfs configuration file
> > documenting the user-visible filesystem featuresets of the configured
> > filesystem.  This can be used to emit default configuration files as we
> > do once a year for each LTS.
> > 
> > Note that geometry information is not written to the configuration file.
> > 
> > Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> > ---
> >  libfrog/fsgeom.h       |    3 
> >  libfrog/fsgeom.c       |  376 ++++++++++++++++++++++++++++++++++++++++++++++++
> >  man/man8/mkfs.xfs.8.in |    6 +
> >  mkfs/xfs_mkfs.c        |   44 +++++-
> >  4 files changed, 428 insertions(+), 1 deletion(-)
> > 
> > ...
> > 
> > diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> > index 74bbb677eee2b6..212e17a354d8be 100644
> > --- a/mkfs/xfs_mkfs.c
> > +++ b/mkfs/xfs_mkfs.c
> > @@ -61,6 +61,7 @@ enum {
> >  
> >  enum {
> >  	C_OPTFILE = 0,
> > +	C_MAKECFG,
> >  	C_MAX_OPTS,
> >  };
> >  
> > @@ -312,6 +313,7 @@ static struct opt_params copts = {
> >  	.name = 'c',
> >  	.subopts = {
> >  		[C_OPTFILE] = "options",
> > +		[C_MAKECFG] = "makecfg",
> >  		[C_MAX_OPTS] = NULL,
> >  	},
> >  	.subopt_params = {
> > @@ -319,6 +321,10 @@ static struct opt_params copts = {
> >  		  .conflicts = { { NULL, LAST_CONFLICT } },
> >  		  .defaultval = SUBOPT_NEEDS_VAL,
> >  		},
> > +		{ .index = C_MAKECFG,
> > +		  .conflicts = { { NULL, LAST_CONFLICT } },
> > +		  .defaultval = 1,
> > +		},
> >  	},
> >  };
> >  
> > @@ -1072,6 +1078,7 @@ struct cli_params {
> >  
> >  	char	*cfgfile;
> >  	char	*protofile;
> > +	char	*makecfg;
> >  
> >  	enum fsprop_autofsck autofsck;
> >  
> > @@ -1207,7 +1214,7 @@ usage( void )
> >  {
> >  	fprintf(stderr, _("Usage: %s\n\
> >  /* blocksize */		[-b size=num]\n\
> > -/* config file */	[-c options=xxx]\n\
> > +/* config file */	[-c options=xxx,makecfg=0|1]\n\
> 
> Shouldn't this be makecfg=xxx?

I think they all should be "=path" because they take file paths
specifically.  I'll amend this patch to change this to

/* config file */  [-c options=path,makecfg=path]\n\

> Otherwise, looks good to me
> Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>

Thanks for reviewing!  A Sashiko review (I can run that internally now)
generated some complaints about xfrog_write_mkfs_config not handling the
quota mkfs options on metadir filesystems, and that there are a couple
of V4 options that it should emit.  I'll resend the series with those
two pieces of new functionality.

--D

> -- 
> - Andrey
> 

  reply	other threads:[~2026-09-03 21:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 23:26 [PATCHSET 2/2] xfsprogs: generate mkfs.xfs config files Darrick J. Wong
2026-08-31 23:26 ` [PATCH 1/5] mkfs: automatically upgrade autofsck earlier Darrick J. Wong
2026-09-03 11:17   ` Andrey Albershteyn
2026-08-31 23:27 ` [PATCH 2/5] mkfs: print config file for a given mkfs configuration Darrick J. Wong
2026-09-03 11:14   ` Andrey Albershteyn
2026-09-03 21:49     ` Darrick J. Wong [this message]
2026-08-31 23:27 ` [PATCH 3/5] xfs_db: print configuration file for mounted filesystems Darrick J. Wong
2026-09-03 11:20   ` Andrey Albershteyn
2026-08-31 23:27 ` [PATCH 4/5] xfs_spaceman: " Darrick J. Wong
2026-09-03 11:20   ` Andrey Albershteyn
2026-08-31 23:27 ` [PATCH 5/5] xfs_admin: " Darrick J. Wong
2026-09-03 11:21   ` Andrey Albershteyn
2026-08-31 23:34 ` [PATCH RFC] xfs: test mkfs.xfs config file generation Darrick J. Wong
2026-09-03 11:21   ` Andrey Albershteyn

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=20260903214909.GW1933798@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=aalbersh@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.