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 7/7] common: fix _require_xfs_io_command pwrite -A for various blocksizes
Date: Wed, 27 Aug 2025 11:04:47 -0700 [thread overview]
Message-ID: <20250827180447.GA8092@frogsfrogsfrogs> (raw)
In-Reply-To: <20250801185315.2d2mfehoqybtiizb@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com>
On Sat, Aug 02, 2025 at 02:53:15AM +0800, Zorro Lang wrote:
> On Tue, Jul 29, 2025 at 01:10:04PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> >
> > In this predicate, we should test an atomic write of the minimum
> > supported size, not just 4k. This fixes a problem where none of the
> > atomic write tests actually run on a 32k-fsblock xfs because you can't
> > do a sub-fsblock atomic write.
> >
> > Cc: <fstests@vger.kernel.org> # v2025.04.13
> > Fixes: d90ee3b6496346 ("generic: add a test for atomic writes")
> > Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> > ---
> > common/rc | 14 +++++++++++---
> > 1 file changed, 11 insertions(+), 3 deletions(-)
> >
> >
> > diff --git a/common/rc b/common/rc
> > index 96578d152dafb9..177e7748f4bb89 100644
> > --- a/common/rc
> > +++ b/common/rc
> > @@ -3027,16 +3027,24 @@ _require_xfs_io_command()
> > "pwrite")
> > # -N (RWF_NOWAIT) only works with direct vectored I/O writes
> > local pwrite_opts=" "
> > + local write_size="4k"
> > if [ "$param" == "-N" ]; then
> > opts+=" -d"
> > - pwrite_opts+="-V 1 -b 4k"
> > + pwrite_opts+="-V 1 -b $write_size"
> > fi
> > if [ "$param" == "-A" ]; then
> > opts+=" -d"
> > - pwrite_opts+="-V 1 -b 4k"
> > + # try to write the minimum supported atomic write size
> > + write_size="$($XFS_IO_PROG -f -c "statx -r -m $STATX_WRITE_ATOMIC" $testfile 2>/dev/null | \
> > + grep atomic_write_unit_min | \
> > + grep -o '[0-9]\+')"
> > + if [ -z "$write_size" ] || [ "$write_size" = "0" ]; then
> > + write_size="0 --not-supported"
> ^^^^^^^^^^^^^^^
>
> What is this "--not-supported" for? If write_size="0 --not-supported", will we get...
>
>
> > + fi
> > + pwrite_opts+="-V 1 -b $write_size"
> > fi
> > testio=`$XFS_IO_PROG -f $opts -c \
> > - "pwrite $pwrite_opts $param 0 4k" $testfile 2>&1`
> > + "pwrite $pwrite_opts $param 0 $write_size" $testfile 2>&1`
>
> "pwrite -V 1 -b 0 --not-supported 0 0 --not-supported" at here?
Yes, this is correct. "--not-supported" is not a valid flag to the
pwrite subcommand. I'm injecting it here intentionally when we don't
detect any atomic write capability so that the _require checks will
behave as if xfs_io doesn't support the -A flag, and _notrun the test.
--D
> Thanks,
> Zorro
>
> > param_checked="$pwrite_opts $param"
> > ;;
> > "scrub"|"repair")
> >
>
>
next prev parent reply other threads:[~2025-08-27 18:04 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-29 20:08 [PATCHSET 1/3] fstests: fixes for atomic writes tests Darrick J. Wong
2025-07-29 20:08 ` [PATCH 2/7] generic/427: try to ensure there's some free space before we do the aio test Darrick J. Wong
2025-07-30 14:18 ` Christoph Hellwig
2025-08-12 18:54 ` Darrick J. Wong
2025-08-13 5:15 ` Christoph Hellwig
2025-08-13 6:14 ` Darrick J. Wong
2025-08-13 6:24 ` Christoph Hellwig
2025-08-14 22:16 ` Darrick J. Wong
2025-08-18 4:37 ` Christoph Hellwig
2025-07-29 20:09 ` [PATCH 3/7] generic/767: require fallocate support Darrick J. Wong
2025-07-30 14:19 ` Christoph Hellwig
2025-08-04 7:38 ` John Garry
2025-07-29 20:09 ` [PATCH 4/7] generic/767: only test the hardware atomic write unit Darrick J. Wong
2025-07-30 14:19 ` Christoph Hellwig
2025-08-04 7:41 ` John Garry
2025-07-29 20:09 ` [PATCH 5/7] generic/767: allow on any atomic writes filesystem Darrick J. Wong
2025-08-01 18:56 ` Zorro Lang
2025-08-04 7:50 ` John Garry
2025-07-29 20:09 ` [PATCH 6/7] xfs/838: actually force usage of the realtime device Darrick J. Wong
2025-07-30 14:19 ` Christoph Hellwig
2025-08-04 8:02 ` John Garry
2025-07-29 20:10 ` [PATCH 7/7] common: fix _require_xfs_io_command pwrite -A for various blocksizes Darrick J. Wong
2025-08-01 18:53 ` Zorro Lang
2025-08-27 18:04 ` Darrick J. Wong [this message]
2025-08-04 8:07 ` John Garry
2025-08-01 6:19 ` [PATCHSET 1/3] fstests: fixes for atomic writes tests Zorro Lang
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=20250827180447.GA8092@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;
as well as URLs for NNTP newsgroup(s).