All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org, zlang@redhat.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me
Subject: [PATCH 3/3] various: test is not appropriate for always_cow mode
Date: Tue, 17 Jan 2023 16:43:31 -0800	[thread overview]
Message-ID: <167400102786.1914975.17542930173906194035.stgit@magnolia> (raw)
In-Reply-To: <167400102747.1914975.6709564559821901777.stgit@magnolia>

From: Darrick J. Wong <djwong@kernel.org>

When always_cow mode is enabled, thes tests cannot set up the
preconditions for the functionality that they wants to test and should
be skipped.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/generic/392 |   10 ++++++++++
 tests/xfs/326     |   12 ++++++++++++
 tests/xfs/558     |    6 ++++++
 3 files changed, 28 insertions(+)


diff --git a/tests/generic/392 b/tests/generic/392
index ac4014ab0c..c4bb3f4b92 100755
--- a/tests/generic/392
+++ b/tests/generic/392
@@ -28,6 +28,16 @@ _scratch_mkfs >/dev/null 2>&1
 _require_metadata_journaling $SCRATCH_DEV
 _scratch_mount
 
+# This test requires that i_blocks remains unchanged from the start of the
+# check_inode_metadata call until after recovery is complete.  fpunch calls
+# turn into pagecache writes if the arguments are not aligned to the fs
+# blocksize.  If the range being punched is already mapped to a written extent
+# and alwayscow is enabled, i_blocks will increase by the size of the COW
+# staging extent.  This causes stat to report different numbers for %b, which
+# results in a test failure.  Hence do not run this test if XFS is in alwayscow
+# mode.
+test "$FSTYP" = "xfs" && _require_no_xfs_always_cow
+
 testfile=$SCRATCH_MNT/testfile
 
 # check inode metadata after shutdown
diff --git a/tests/xfs/326 b/tests/xfs/326
index 8ab60684bf..ac620fc433 100755
--- a/tests/xfs/326
+++ b/tests/xfs/326
@@ -43,6 +43,18 @@ _scratch_mount >> $seqres.full
 _require_congruent_file_oplen $SCRATCH_MNT $blksz
 $XFS_IO_PROG -c "cowextsize $sz" $SCRATCH_MNT
 
+# This test uses a very large cowextszhint to manipulate the COW fork to
+# contain a large unwritten extent before injecting the error.  The goal is
+# that the write() will succeed, writeback will flush the dirty data to disk,
+# and writeback completion will shut down the filesystem when it tries to
+# remove the staging extent record from the refcount btree.  In other words,
+# this test ensures that XFS always finishes a COW completion it has started.
+#
+# This test isn't compatible with always_cow mode because the hole in the COW
+# fork left by the first write means that writeback tries to allocate a COW
+# staging extent for an unshared extent and trips over the injected error.
+_require_no_xfs_always_cow
+
 echo "Create files"
 _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full
 _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file2
diff --git a/tests/xfs/558 b/tests/xfs/558
index 819faf22bc..9e9b3be867 100755
--- a/tests/xfs/558
+++ b/tests/xfs/558
@@ -114,6 +114,12 @@ _require_xfs_io_error_injection "wb_delay_ms"
 _require_scratch_reflink
 _require_cp_reflink
 
+# This test races writeback of a pure overwrite of a data fork extent against
+# the creation of a speculative COW preallocation.  In alwayscow mode, there
+# are no pure overwrites, which means that a precondition of the test is not
+# satisfied, and this test should be skipped.
+_require_no_xfs_always_cow
+
 _scratch_mkfs >> $seqres.full
 _scratch_mount >> $seqres.full
 


  parent reply	other threads:[~2023-01-18  0:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18  0:41 [PATCHSET 0/3] fstests: fix tests when XFS always_cow mode enabled Darrick J. Wong
2023-01-18  0:43 ` [PATCH 1/3] xfs: skip fragmentation tests when alwayscow mode is enabled Darrick J. Wong
2023-01-18  5:43   ` Christoph Hellwig
2023-01-18  0:43 ` [PATCH 2/3] xfs/{080,329,434,436}: add missing check for fallocate support Darrick J. Wong
2023-01-18  5:43   ` Christoph Hellwig
2023-01-18  0:43 ` Darrick J. Wong [this message]
2023-01-18  5:43   ` [PATCH 3/3] various: test is not appropriate for always_cow mode 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=167400102786.1914975.17542930173906194035.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --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 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.