From: "Darrick J. Wong" <djwong@kernel.org>
To: John Garry <john.g.garry@oracle.com>
Cc: Catherine Hoang <catherine.hoang@oracle.com>,
linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH 4/6] common/atomicwrites: adjust a few more things
Date: Wed, 14 May 2025 08:40:39 -0700 [thread overview]
Message-ID: <20250514154039.GV25667@frogsfrogsfrogs> (raw)
In-Reply-To: <73af7165-630b-469d-965e-a50c381298cb@oracle.com>
On Wed, May 14, 2025 at 02:11:00PM +0100, John Garry wrote:
> On 14/05/2025 01:29, Catherine Hoang wrote:
> > From: "Darrick J. Wong"<djwong@kernel.org>
> >
> > Always export STATX_WRITE_ATOMIC so anyone can use it, make the "cp
> > reflink" logic work for any filesystem, not just xfs, and create a
> > separate helper to check that the necessary xfs_io support is present.
> >
> > Signed-off-by: "Darrick J. Wong"<djwong@kernel.org>
> > Signed-off-by: Catherine Hoang<catherine.hoang@oracle.com>
>
> Just a small comment query below.
>
> Reviewed-by: John Garry <john.g.garry@oracle.com>
>
> > ---
> > common/atomicwrites | 18 +++++++++++-------
> > tests/generic/765 | 2 +-
> > 2 files changed, 12 insertions(+), 8 deletions(-)
> >
> > diff --git a/common/atomicwrites b/common/atomicwrites
> > index fd3a9b71..9ec1ca68 100644
> > --- a/common/atomicwrites
> > +++ b/common/atomicwrites
> > @@ -4,6 +4,8 @@
> > #
> > # Routines for testing atomic writes.
> > +export STATX_WRITE_ATOMIC=0x10000
> > +
> > _get_atomic_write_unit_min()
> > {
> > $XFS_IO_PROG -c "statx -r -m $STATX_WRITE_ATOMIC" $1 | \
> > @@ -26,8 +28,6 @@ _require_scratch_write_atomic()
> > {
> > _require_scratch
> > - export STATX_WRITE_ATOMIC=0x10000
> > -
> > awu_min_bdev=$(_get_atomic_write_unit_min $SCRATCH_DEV)
> > awu_max_bdev=$(_get_atomic_write_unit_max $SCRATCH_DEV)
> > @@ -51,6 +51,14 @@ _require_scratch_write_atomic()
> > fi
> > }
> > +# Check for xfs_io commands required to run _test_atomic_file_writes
> > +_require_atomic_write_test_commands()
> > +{
> > + _require_xfs_io_command "falloc"
> > + _require_xfs_io_command "fpunch"
> > + _require_xfs_io_command pwrite -A
> > +}
> > +
> > _test_atomic_file_writes()
> > {
> > local bsize="$1"
> > @@ -64,11 +72,7 @@ _test_atomic_file_writes()
> > test $bytes_written -eq $bsize || echo "atomic write len=$bsize failed"
> > # Check that we can perform an atomic single-block cow write
> > - if [ "$FSTYP" == "xfs" ]; then
> > - testfile_cp=$SCRATCH_MNT/testfile_copy
> > - if _xfs_has_feature $SCRATCH_MNT reflink; then
> > - cp --reflink $testfile $testfile_cp
> > - fi
> > + if cp --reflink=always $testfile $testfile_cp 2>> $seqres.full; then
>
> I suppose that previously for xfs where the cp --reflink failed, we would
> pointlessly try the write - am I correct?
Correct.
> If so, now seems much better.
That and any filesystem that supports reflink and atomic writes will now
test this. :)
Thanks for review!
--D
> > bytes_written=$($XFS_IO_PROG -dc "pwrite -A -D -V1 -b $bsize 0 $bsize" $testfile_cp | \
>
>
next prev parent reply other threads:[~2025-05-14 15:40 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 0:29 [PATCH 0/6] atomic writes tests Catherine Hoang
2025-05-14 0:29 ` [PATCH 1/6] generic/765: fix a few issues Catherine Hoang
2025-05-14 12:47 ` John Garry
2025-05-14 15:38 ` Darrick J. Wong
2025-05-14 23:42 ` Catherine Hoang
2025-05-15 1:47 ` Darrick J. Wong
2025-05-15 8:16 ` John Garry
2025-05-15 14:54 ` Darrick J. Wong
2025-05-15 17:57 ` John Garry
2025-05-15 21:50 ` Catherine Hoang
2025-05-16 6:59 ` John Garry
2025-05-17 3:17 ` Ritesh Harjani
2025-05-14 0:29 ` [PATCH 2/6] generic/765: adjust various things Catherine Hoang
2025-05-14 12:59 ` John Garry
2025-05-17 3:36 ` Ritesh Harjani
2025-05-14 0:29 ` [PATCH 3/6] generic/765: move common atomic write code to a library file Catherine Hoang
2025-05-14 13:00 ` John Garry
2025-05-17 3:49 ` Ritesh Harjani
2025-05-14 0:29 ` [PATCH 4/6] common/atomicwrites: adjust a few more things Catherine Hoang
2025-05-14 13:11 ` John Garry
2025-05-14 15:40 ` Darrick J. Wong [this message]
2025-05-17 3:59 ` Ritesh Harjani
2025-05-14 0:29 ` [PATCH 5/6] common/atomicwrites: fix _require_scratch_write_atomic Catherine Hoang
2025-05-14 13:14 ` John Garry
2025-05-14 0:29 ` [PATCH 6/6] generic: various atomic write tests with scsi_debug Catherine Hoang
2025-05-14 13:41 ` John Garry
2025-05-14 16:01 ` Darrick J. Wong
2025-05-14 16:30 ` John Garry
2025-05-14 23:49 ` Catherine Hoang
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=20250514154039.GV25667@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=catherine.hoang@oracle.com \
--cc=fstests@vger.kernel.org \
--cc=john.g.garry@oracle.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).