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 1/3] xfs: skip fragmentation tests when alwayscow mode is enabled
Date: Tue, 17 Jan 2023 16:43:00 -0800	[thread overview]
Message-ID: <167400102759.1914975.16224258103457998795.stgit@magnolia> (raw)
In-Reply-To: <167400102747.1914975.6709564559821901777.stgit@magnolia>

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

If the always_cow debugging flag is enabled, all file writes turn into
copy writes.  This dramatically ramps up fragmentation in the filesystem
(intentionally!) so there's no point in complaining about fragmentation.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/xfs    |    9 +++++++++
 tests/xfs/182 |    1 +
 tests/xfs/192 |    1 +
 tests/xfs/198 |    1 +
 tests/xfs/204 |    1 +
 tests/xfs/211 |    1 +
 6 files changed, 14 insertions(+)


diff --git a/common/xfs b/common/xfs
index 7eee76c0ee..a00d90a4b5 100644
--- a/common/xfs
+++ b/common/xfs
@@ -1108,6 +1108,15 @@ _require_no_xfs_bug_on_assert()
 	fi
 }
 
+# Require that XFS is not configured in always_cow mode.
+_require_no_xfs_always_cow()
+{
+	if [ -f /sys/fs/xfs/debug/always_cow ]; then
+		grep -q "1" /sys/fs/xfs/debug/always_cow && \
+		   _notrun "test requires XFS always_cow to be off, turn it off to run the test"
+	fi
+}
+
 # Get a metadata field
 # The first arg is the field name
 # The rest of the arguments are xfs_db commands to find the metadata.
diff --git a/tests/xfs/182 b/tests/xfs/182
index 696b933e60..511aca6f2d 100755
--- a/tests/xfs/182
+++ b/tests/xfs/182
@@ -24,6 +24,7 @@ _require_cp_reflink
 _require_xfs_io_command "fiemap"
 _require_xfs_io_command "cowextsize"
 _require_odirect
+_require_no_xfs_always_cow	# writes have to converge to overwrites
 
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1
diff --git a/tests/xfs/192 b/tests/xfs/192
index ced18fa3c1..eb577f15fc 100755
--- a/tests/xfs/192
+++ b/tests/xfs/192
@@ -26,6 +26,7 @@ _require_xfs_io_command "fiemap"
 _require_xfs_io_command "cowextsize"
 _require_xfs_io_command "funshare"
 _require_odirect
+_require_no_xfs_always_cow	# writes have to converge to overwrites
 
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1
diff --git a/tests/xfs/198 b/tests/xfs/198
index c61fbab70d..e5b98609de 100755
--- a/tests/xfs/198
+++ b/tests/xfs/198
@@ -23,6 +23,7 @@ _require_cp_reflink
 _require_xfs_io_command "fiemap"
 _require_xfs_io_command "cowextsize"
 _require_odirect
+_require_no_xfs_always_cow	# writes have to converge to overwrites
 
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1
diff --git a/tests/xfs/204 b/tests/xfs/204
index ca21dfe722..7d6b79a86d 100755
--- a/tests/xfs/204
+++ b/tests/xfs/204
@@ -28,6 +28,7 @@ _require_xfs_io_command "fiemap"
 _require_xfs_io_command "cowextsize"
 _require_xfs_io_command "funshare"
 _require_odirect
+_require_no_xfs_always_cow	# writes have to converge to overwrites
 
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1
diff --git a/tests/xfs/211 b/tests/xfs/211
index 96c0b85b14..3ce6496afc 100755
--- a/tests/xfs/211
+++ b/tests/xfs/211
@@ -24,6 +24,7 @@ _require_cp_reflink
 _require_xfs_io_command "fiemap"
 _require_xfs_io_command "cowextsize"
 _require_odirect
+_require_no_xfs_always_cow	# writes have to converge to overwrites
 
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1


  reply	other threads:[~2023-01-18  0:55 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 ` Darrick J. Wong [this message]
2023-01-18  5:43   ` [PATCH 1/3] xfs: skip fragmentation tests when alwayscow mode is enabled 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 ` [PATCH 3/3] various: test is not appropriate for always_cow mode Darrick J. Wong
2023-01-18  5:43   ` 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=167400102759.1914975.16224258103457998795.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.