All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shiyang Ruan <ruansy.fnst@fujitsu.com>
To: <fstests@vger.kernel.org>
Cc: <ruansy.fnst@fujitsu.com>
Subject: [PATCH v3 05/17] common/rc: Introduce _require_scratch_delalloc()
Date: Tue, 14 Dec 2021 16:19:02 +0800	[thread overview]
Message-ID: <20211214081914.2478122-6-ruansy.fnst@fujitsu.com> (raw)
In-Reply-To: <20211214081914.2478122-1-ruansy.fnst@fujitsu.com>

Check whether delalloc is supported on current device.

Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
---
 common/rc         | 13 +++++++++++++
 tests/generic/194 |  1 +
 tests/generic/195 |  1 +
 tests/generic/199 |  1 +
 tests/generic/200 |  1 +
 tests/generic/293 |  1 +
 tests/generic/295 |  1 +
 tests/generic/540 |  1 +
 tests/generic/541 |  1 +
 tests/generic/542 |  1 +
 tests/generic/543 |  1 +
 tests/xfs/172     | 12 +-----------
 tests/xfs/223     |  1 +
 tests/xfs/224     |  1 +
 tests/xfs/228     |  1 +
 tests/xfs/230     |  1 +
 tests/xfs/257     |  1 +
 tests/xfs/258     |  1 +
 18 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/common/rc b/common/rc
index 7973ceb5..a419b3ba 100644
--- a/common/rc
+++ b/common/rc
@@ -1748,6 +1748,19 @@ _require_scratch_16T_support()
 	esac
 }
 
+# Require scratch fs supports delay allocation.
+_require_scratch_delalloc()
+{
+	_require_command "$FILEFRAG_PROG" filefrag
+
+	_scratch_mkfs > $seqres.full
+	_scratch_mount
+	$XFS_IO_PROG -f -c 'pwrite 0 64k' $SCRATCH_MNT/testy &> /dev/null
+	$FILEFRAG_PROG -v $SCRATCH_MNT/testy 2>&1 | grep -q delalloc || \
+		_notrun "test requires delayed allocation buffered writes"
+	_scratch_unmount
+}
+
 # this test needs a test partition - check we're ok & mount it
 #
 _require_test()
diff --git a/tests/generic/194 b/tests/generic/194
index ce8c31ac..ff76438d 100755
--- a/tests/generic/194
+++ b/tests/generic/194
@@ -28,6 +28,7 @@ _cleanup()
 
 # real QA test starts here
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 _require_odirect
 
diff --git a/tests/generic/195 b/tests/generic/195
index da502c39..e087b99c 100755
--- a/tests/generic/195
+++ b/tests/generic/195
@@ -28,6 +28,7 @@ _cleanup()
 
 # real QA test starts here
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 
 echo "Format and mount"
diff --git a/tests/generic/199 b/tests/generic/199
index ab13f58e..2a8cafcc 100755
--- a/tests/generic/199
+++ b/tests/generic/199
@@ -31,6 +31,7 @@ _cleanup()
 
 # real QA test starts here
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "fpunch"
 _require_cp_reflink
diff --git a/tests/generic/200 b/tests/generic/200
index deadfeaa..a1a78ef4 100755
--- a/tests/generic/200
+++ b/tests/generic/200
@@ -31,6 +31,7 @@ _cleanup()
 
 # real QA test starts here
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "fpunch"
 _require_cp_reflink
diff --git a/tests/generic/293 b/tests/generic/293
index 74231b4d..0f1d8416 100755
--- a/tests/generic/293
+++ b/tests/generic/293
@@ -24,6 +24,7 @@ _begin_fstest auto quick clone
 
 # real QA test starts here
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 
 echo "Format and mount"
diff --git a/tests/generic/295 b/tests/generic/295
index b921c79b..f66c1805 100755
--- a/tests/generic/295
+++ b/tests/generic/295
@@ -24,6 +24,7 @@ _begin_fstest auto quick clone
 
 # real QA test starts here
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 _require_odirect
 
diff --git a/tests/generic/540 b/tests/generic/540
index 69cf635f..38e00f97 100755
--- a/tests/generic/540
+++ b/tests/generic/540
@@ -26,6 +26,7 @@ _begin_fstest auto quick clone
 # real QA test starts here
 _supported_fs generic
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 
 echo "Format and mount"
diff --git a/tests/generic/541 b/tests/generic/541
index 925f346e..89b2adad 100755
--- a/tests/generic/541
+++ b/tests/generic/541
@@ -26,6 +26,7 @@ _begin_fstest auto quick clone
 # real QA test starts here
 _supported_fs generic
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 
 echo "Format and mount"
diff --git a/tests/generic/542 b/tests/generic/542
index e3e627a8..e7682f59 100755
--- a/tests/generic/542
+++ b/tests/generic/542
@@ -26,6 +26,7 @@ _begin_fstest auto quick clone
 # real QA test starts here
 _supported_fs generic
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 
 echo "Format and mount"
diff --git a/tests/generic/543 b/tests/generic/543
index 047bedd5..624cfc41 100755
--- a/tests/generic/543
+++ b/tests/generic/543
@@ -26,6 +26,7 @@ _begin_fstest auto quick clone
 # real QA test starts here
 _supported_fs generic
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 
 echo "Format and mount"
diff --git a/tests/xfs/172 b/tests/xfs/172
index c0495305..56c2583b 100755
--- a/tests/xfs/172
+++ b/tests/xfs/172
@@ -16,7 +16,6 @@ _begin_fstest rw filestreams
 
 # real QA test starts here
 _supported_fs xfs
-_require_command "$FILEFRAG_PROG" filefrag
 _require_scratch
 
 # The first _test_streams call sets up the filestreams allocator to fail and
@@ -36,16 +35,7 @@ _require_scratch
 # rescan thresholds and will keep pushing out the expiration time, with the
 # result that the filestreams allocator succeeds in maintaining the streams.
 # The test considers this a failure.
-#
-# Make sure that a regular buffered write produces delalloc reservations.
-# This effectively disables the test for files with extent size hints or DAX
-# mode set.
-_scratch_mkfs > $seqres.full
-_scratch_mount
-$XFS_IO_PROG -f -c 'pwrite 0 64k' $SCRATCH_MNT/testy &> /dev/null
-$FILEFRAG_PROG -v $SCRATCH_MNT/testy 2>&1 | grep -q delalloc || \
-	_notrun "test requires delayed allocation buffered writes"
-_scratch_unmount
+_require_scratch_delalloc
 
 _check_filestreams_support || _notrun "filestreams not available"
 
diff --git a/tests/xfs/223 b/tests/xfs/223
index f002f1de..11dbad14 100755
--- a/tests/xfs/223
+++ b/tests/xfs/223
@@ -22,6 +22,7 @@ _begin_fstest auto quick clone
 
 # real QA test starts here
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "cowextsize"
 _require_odirect
diff --git a/tests/xfs/224 b/tests/xfs/224
index 11a54fa3..f8bab07e 100755
--- a/tests/xfs/224
+++ b/tests/xfs/224
@@ -22,6 +22,7 @@ _begin_fstest auto quick clone
 
 # real QA test starts here
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "cowextsize"
 
diff --git a/tests/xfs/228 b/tests/xfs/228
index 5c644c0f..f2f2f6a9 100755
--- a/tests/xfs/228
+++ b/tests/xfs/228
@@ -25,6 +25,7 @@ _begin_fstest auto quick clone punch
 
 # real QA test starts here
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "cowextsize"
 _require_xfs_io_command "fpunch"
diff --git a/tests/xfs/230 b/tests/xfs/230
index 53e8dd78..15f6b684 100755
--- a/tests/xfs/230
+++ b/tests/xfs/230
@@ -25,6 +25,7 @@ _begin_fstest auto quick clone punch
 
 # real QA test starts here
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "cowextsize"
 _require_xfs_io_command "fpunch"
diff --git a/tests/xfs/257 b/tests/xfs/257
index acd55c22..6a58f0ac 100755
--- a/tests/xfs/257
+++ b/tests/xfs/257
@@ -25,6 +25,7 @@ _begin_fstest auto quick clone
 
 # real QA test starts here
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "cowextsize"
 
diff --git a/tests/xfs/258 b/tests/xfs/258
index 25e8eb60..2865cdf9 100755
--- a/tests/xfs/258
+++ b/tests/xfs/258
@@ -25,6 +25,7 @@ _begin_fstest auto quick clone
 
 # real QA test starts here
 _require_scratch_reflink
+_require_scratch_delalloc
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "cowextsize"
 _require_odirect
-- 
2.34.1




  parent reply	other threads:[~2021-12-14  8:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14  8:18 [PATCH v3 00/17] generic: add some mmap CoW tests Shiyang Ruan
2021-12-14  8:18 ` [PATCH v3 01/17] generic: add mmap CoW test for ranges of two shared files Shiyang Ruan
2021-12-14  8:18 ` [PATCH v3 02/17] generic: add mmap CoW test for regular&destination extents Shiyang Ruan
2021-12-14  8:19 ` [PATCH v3 03/17] generic: add mmap CoW test for unwritten&destination extents Shiyang Ruan
2021-12-14  8:19 ` [PATCH v3 04/17] generic: add mmap CoW test for holes&destination extents Shiyang Ruan
2021-12-14  8:19 ` Shiyang Ruan [this message]
2021-12-14  8:19 ` [PATCH v3 06/17] generic: add mmap CoW test for delalloc&destination extents Shiyang Ruan
2021-12-14  8:19 ` [PATCH v3 07/17] generic: add mmap CoW test for mixed&destination extents Shiyang Ruan
2021-12-14  8:19 ` [PATCH v3 08/17] generic: add mmap CoW test for regular&source extents Shiyang Ruan
2021-12-14  8:19 ` [PATCH v3 09/17] generic: add mmap CoW test for unwritten&source extents Shiyang Ruan
2021-12-14  8:19 ` [PATCH v3 10/17] generic: add mmap CoW test for holes&source extents Shiyang Ruan
2021-12-14  8:19 ` [PATCH v3 11/17] generic: add mmap CoW test for delalloc&source extents Shiyang Ruan
2021-12-14  8:19 ` [PATCH v3 12/17] generic: add buffered-io CoW test for mixed&source extents Shiyang Ruan
2021-12-25 13:27   ` Eryu Guan
2021-12-14  8:19 ` [PATCH v3 13/17] generic: add direct-io " Shiyang Ruan
2021-12-14  8:19 ` [PATCH v3 14/17] generic: add mmap " Shiyang Ruan
2021-12-14  8:19 ` [PATCH v3 15/17] generic: add race test between reflink and mmap read Shiyang Ruan
2022-01-11 18:55   ` Darrick J. Wong
2022-01-12  2:38     ` Shiyang Ruan
2021-12-14  8:19 ` [PATCH v3 16/17] generic: add race test that mmap write to source of reflink Shiyang Ruan
2021-12-14  8:19 ` [PATCH v3 17/17] generic: add race test that mmap write to target " Shiyang Ruan
2021-12-19 16:04 ` [PATCH v3 00/17] generic: add some mmap CoW tests Eryu Guan

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=20211214081914.2478122-6-ruansy.fnst@fujitsu.com \
    --to=ruansy.fnst@fujitsu.com \
    --cc=fstests@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 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.