public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Zorro Lang <zlang@redhat.com>
Cc: fstests@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 12/12] xfs/157: fix test failures when MKFS_OPTIONS has -L options
Date: Thu, 21 Nov 2024 09:19:53 -0800	[thread overview]
Message-ID: <20241121171953.GW9425@frogsfrogsfrogs> (raw)
In-Reply-To: <20241121101712.qdtdk63aq6kp4pdm@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com>

On Thu, Nov 21, 2024 at 06:17:12PM +0800, Zorro Lang wrote:
> On Mon, Nov 18, 2024 at 03:04:31PM -0800, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > Zorro reports that this test fails if the test runner set an -L (label)
> > option in MKFS_OPTIONS.  Fix the test to work around this with a bunch
> 
> I didn't hit the xfs/157 failure by setting "-L label" in MKFS_OPTIONS,
> I set MKFS_OPTIONS="-m rmapbt=1" in local.config, then "-m rmapbt=1" is
> conflict with rtdev, that cause the "-L oldlabel" be dropped by
> _scratch_mkfs_sized.
> 
> I don't mind having this "xfs/157 enhancement" patch. But as we've talked,
> I don't think any testers would like to write MKFS_OPTIONS="-L label" in
> local.config. So this patch might not be necessary. What do you think?

Yeah, I guess I will drop it then.

--D

> Thanks,
> Zorro
> 
> > of horrid sed filtering magic.  It's probably not *critical* to make
> > this test test work with random labels, but it'd be nice not to lose
> > them.
> > 
> > Cc: <fstests@vger.kernel.org> # v2024.10.14
> > Fixes: 2f7e1b8a6f09b6 ("xfs/157,xfs/547,xfs/548: switch to using _scratch_mkfs_sized")
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> >  tests/xfs/157 |   29 +++++++++++++++++++++++++++--
> >  1 file changed, 27 insertions(+), 2 deletions(-)
> > 
> > 
> > diff --git a/tests/xfs/157 b/tests/xfs/157
> > index e102a5a10abe4b..0c21786e389695 100755
> > --- a/tests/xfs/157
> > +++ b/tests/xfs/157
> > @@ -65,9 +65,34 @@ scenario() {
> >  	SCRATCH_RTDEV=$orig_rtdev
> >  }
> >  
> > +extract_mkfs_label() {
> > +	set -- $MKFS_OPTIONS
> > +	local in_l
> > +
> > +	for arg in "$@"; do
> > +		if [ "$in_l" = "1" ]; then
> > +			echo "$arg"
> > +			return 0
> > +		elif [ "$arg" = "-L" ]; then
> > +			in_l=1
> > +		fi
> > +	done
> > +	return 1
> > +}
> > +
> >  check_label() {
> > -	_scratch_mkfs_sized "$fs_size" "" -L oldlabel >> $seqres.full 2>&1
> > -	_scratch_xfs_db -c label
> > +	local existing_label
> > +	local filter
> > +
> > +	# Handle -L somelabel being set in MKFS_OPTIONS
> > +	if existing_label="$(extract_mkfs_label)"; then
> > +		filter=(sed -e "s|$existing_label|oldlabel|g")
> > +		_scratch_mkfs_sized $fs_size >> $seqres.full
> > +	else
> > +		filter=(cat)
> > +		_scratch_mkfs_sized "$fs_size" "" -L oldlabel >> $seqres.full 2>&1
> > +	fi
> > +	_scratch_xfs_db -c label | "${filter[@]}"
> >  	_scratch_xfs_admin -L newlabel "$@" >> $seqres.full
> >  	_scratch_xfs_db -c label
> >  	_scratch_xfs_repair -n &>> $seqres.full || echo "Check failed?"
> > 
> 
> 

      reply	other threads:[~2024-11-21 17:19 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-18 23:01 [PATCHSET] fstests: random fixes for v2024.11.17 Darrick J. Wong
2024-11-18 23:01 ` [PATCH 01/12] generic/757: fix various bugs in this test Darrick J. Wong
2024-11-21  9:56   ` Zorro Lang
2024-11-21 10:05     ` Christoph Hellwig
2024-11-21 10:13       ` Christoph Hellwig
2024-11-21 10:52         ` Christoph Hellwig
2024-11-21 16:33           ` Darrick J. Wong
2024-11-21 17:19             ` Darrick J. Wong
2024-11-22 12:35               ` Christoph Hellwig
2024-11-21 12:28       ` Brian Foster
2024-11-21 13:12         ` Christoph Hellwig
2024-11-21 14:11           ` Brian Foster
2024-11-22 12:31             ` Christoph Hellwig
2024-11-22 13:49               ` Brian Foster
2024-11-22 16:13                 ` Darrick J. Wong
2024-11-22 16:20                   ` Christoph Hellwig
2024-11-22 16:33                   ` Brian Foster
2024-11-22 16:37                     ` Darrick J. Wong
2024-11-21 16:04         ` Darrick J. Wong
2024-11-22 12:34           ` Christoph Hellwig
2024-11-18 23:01 ` [PATCH 02/12] xfs/113: fix failure to corrupt the entire directory Darrick J. Wong
2024-11-18 23:02 ` [PATCH 03/12] xfs/508: fix test for 64k blocksize Darrick J. Wong
2024-11-18 23:02 ` [PATCH 04/12] common/rc: capture dmesg when oom kills happen Darrick J. Wong
2024-11-18 23:02 ` [PATCH 05/12] generic/562: handle ENOSPC while cloning gracefully Darrick J. Wong
2024-11-19  0:17   ` Filipe Manana
2024-11-19  0:31     ` Darrick J. Wong
2024-11-25  5:18       ` Darrick J. Wong
2024-11-18 23:02 ` [PATCH 06/12] xfs/163: skip test if we can't shrink due to enospc issues Darrick J. Wong
2024-11-19  6:11   ` Christoph Hellwig
2024-11-18 23:03 ` [PATCH 07/12] xfs/009: allow logically contiguous preallocations Darrick J. Wong
2024-11-19  6:11   ` Christoph Hellwig
2024-11-18 23:03 ` [PATCH 08/12] generic/251: use sentinel files to kill the fstrim loop Darrick J. Wong
2024-11-19  6:11   ` Christoph Hellwig
2024-11-18 23:03 ` [PATCH 09/12] generic/251: constrain runtime via time/load/soak factors Darrick J. Wong
2024-11-19  1:45   ` Dave Chinner
2024-11-19  6:13     ` Christoph Hellwig
2024-11-19 15:45       ` Darrick J. Wong
2024-11-19 21:04         ` Dave Chinner
2024-11-19 21:16           ` Darrick J. Wong
2024-11-19 15:50     ` Darrick J. Wong
2024-11-18 23:03 ` [PATCH 10/12] common/rc: _scratch_mkfs_sized supports extra arguments Darrick J. Wong
2024-11-18 23:04 ` [PATCH 11/12] xfs/157: do not drop necessary mkfs options Darrick J. Wong
2024-11-21 10:03   ` Zorro Lang
2024-11-18 23:04 ` [PATCH 12/12] xfs/157: fix test failures when MKFS_OPTIONS has -L options Darrick J. Wong
2024-11-21 10:17   ` Zorro Lang
2024-11-21 17:19     ` 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=20241121171953.GW9425@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zlang@redhat.com \
    /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