Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Zorro Lang <zlang@kernel.org>,
	fstests@vger.kernel.org, xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] xfs/21[67]: fix mkfs log concurrency detection
Date: Thu, 28 May 2026 21:21:31 -0700	[thread overview]
Message-ID: <20260529042131.GA6070@frogsfrogsfrogs> (raw)
In-Reply-To: <ahPiIAJNwjiZ9PTR@infradead.org>

On Sun, May 24, 2026 at 10:46:08PM -0700, Christoph Hellwig wrote:
> On Wed, May 20, 2026 at 12:01:12PM -0700, Darrick J. Wong wrote:
> > +_mkfs_xfs_supported()
> 
> Can you add a top of function comment explaininging this helper?

Done:

# Figure out if the supplied mkfs.xfs options are supported.  A device
# or file path must be specified as one of the options, though it will
# not be written.

> > +{
> > +	local mkfs_opts=$*
> > +
> > +	$MKFS_XFS_PROG -f -N $MKFS_OPTIONS $mkfs_opts
> > +	local mkfs_status=$?
> > +
> > +	# a mkfs failure may be caused by conflicts between $MKFS_OPTIONS and
> > +	# $mkfs_opts, try again without $MKFS_OPTIONS
> > +	if [ $mkfs_status -ne 0 -a -n "$mkfs_opts" ]; then
> > +		$MKFS_XFS_PROG -f -N $mkfs_opts
> > +		mkfs_status=$?
> > +	fi
> 
> Do we want this for a helper like this?  The automatic dropping of
> options has been a major source of mess, and if we're using a helper
> that checks to see if mkfs works, returning false and then _notrun()ing
> would seem like the saner option in general.

I copy-pasted it from the other helper, but now that I've written the
doc comment I agree with you that we should only determine if the
passed-in option set actually works.

Digression: I wonder if _scratch_mkfs_xfs_supported should have a
"-f" in its $XFS_MKFS_PROG invocations?

--D

  reply	other threads:[~2026-05-29  4:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 18:52 [PATCH 1/2] common/xfs: fix _scratch_mkfs_xfs_supports_concurrency Darrick J. Wong
2026-05-20 19:01 ` [PATCH 2/2] xfs/21[67]: fix mkfs log concurrency detection Darrick J. Wong
2026-05-25  5:46   ` Christoph Hellwig
2026-05-29  4:21     ` Darrick J. Wong [this message]
2026-05-29  5:45       ` Christoph Hellwig
2026-05-29  9:43   ` Zorro Lang
2026-05-25  5:43 ` [PATCH 1/2] common/xfs: fix _scratch_mkfs_xfs_supports_concurrency Christoph Hellwig

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=20260529042131.GA6070@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zlang@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