fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org, guaneryu@gmail.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me
Subject: [PATCH 8/9] generic/{094,225}: skip test when the xfs rt extent size is larger than 1 fsb
Date: Tue, 13 Apr 2021 18:05:20 -0700	[thread overview]
Message-ID: <161836232004.2754991.941115577343319256.stgit@magnolia> (raw)
In-Reply-To: <161836227000.2754991.9697150788054520169.stgit@magnolia>

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

These two tests call various fallocate modes on a file and compare the
FIEMAP output to some golden output.  Unfortunately, the golden output
doesn't take into account the possibility that (on XFS) the files could be
created on a realtime volume with a large rt extent size set.

Under such a configuration, fpunch operations that are aligned to the fs
block size but not the rt extent size simply result in those blocks
being set to unwritten status.  Unfortunately, the test expects holes
and fails.  Therefore, detect the situation and skip the tests.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/rc         |   10 ++++++++++
 tests/generic/094 |    5 +++++
 tests/generic/225 |    5 +++++
 3 files changed, 20 insertions(+)


diff --git a/common/rc b/common/rc
index bb54df56..b5e930de 100644
--- a/common/rc
+++ b/common/rc
@@ -4062,6 +4062,16 @@ _get_block_size()
 	stat -f -c %S $1
 }
 
+# Require that the fundamental allocation unit of a file is the same as the
+# filesystem block size.
+_require_file_block_size_equals_fs_block_size()
+{
+	local file_alloc_unit="$(_get_file_block_size $1)"
+	local fs_block_size="$(_get_block_size $1)"
+	test "$file_alloc_unit" != "$fs_block_size" && \
+		_notrun "File allocation unit is larger than a filesystem block"
+}
+
 get_page_size()
 {
 	echo $(getconf PAGE_SIZE)
diff --git a/tests/generic/094 b/tests/generic/094
index d371e951..8c292473 100755
--- a/tests/generic/094
+++ b/tests/generic/094
@@ -40,6 +40,11 @@ fiemapfile=$SCRATCH_MNT/$seq.fiemap
 
 _require_test_program "fiemap-tester"
 
+# FIEMAP test doesn't like finding unwritten blocks after it punches out
+# a partial rt extent.
+test "$FSTYP" = "xfs" && \
+	_require_file_block_size_equals_fs_block_size $fiemapfile
+
 seed=`date +%s`
 
 echo "using seed $seed" >> $seqres.full
diff --git a/tests/generic/225 b/tests/generic/225
index 1228a256..fac688df 100755
--- a/tests/generic/225
+++ b/tests/generic/225
@@ -40,6 +40,11 @@ fiemaplog=$SCRATCH_MNT/$seq.log
 
 _require_test_program "fiemap-tester"
 
+# FIEMAP test doesn't like finding unwritten blocks after it punches out
+# a partial rt extent.
+test "$FSTYP" = "xfs" && \
+	_require_file_block_size_equals_fs_block_size $fiemapfile
+
 seed=`date +%s`
 
 echo "using seed $seed" >> $fiemaplog


  parent reply	other threads:[~2021-04-14  1:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14  1:04 [PATCHSET 0/9] fstests: random fixes Darrick J. Wong
2021-04-14  1:04 ` [PATCH 1/9] xfs/506: fix regression on freshly quotachecked filesystem Darrick J. Wong
2021-04-14  6:12   ` Christoph Hellwig
2021-04-14  1:04 ` [PATCH 2/9] generic/563: selectively remove the io cgroup controller Darrick J. Wong
2021-04-14  6:13   ` Christoph Hellwig
2021-04-14  1:04 ` [PATCH 3/9] xfs/521,530: refactor scratch fs check Darrick J. Wong
2021-04-14  6:15   ` Christoph Hellwig
2021-04-14  1:04 ` [PATCH 4/9] common/dump: filter out xfs_restore messages about fallocate failures Darrick J. Wong
2021-04-14  6:16   ` Christoph Hellwig
2021-04-14  1:05 ` [PATCH 5/9] common/dmthin: make this work with external log devices Darrick J. Wong
2021-04-14  6:17   ` Christoph Hellwig
2021-04-18 12:25   ` Eryu Guan
2021-04-18 14:44     ` Theodore Ts'o
2021-04-19  2:04       ` Dave Chinner
2021-04-19 16:14         ` Darrick J. Wong
2021-04-14  1:05 ` [PATCH 6/9] misc: replace more open-coded _scratch_xfs_db calls Darrick J. Wong
2021-04-14  6:18   ` Christoph Hellwig
2021-04-14  1:05 ` [PATCH 7/9] generic/620: fix order of require_scratch calls Darrick J. Wong
2021-04-14  6:20   ` Christoph Hellwig
2021-04-14  1:05 ` Darrick J. Wong [this message]
2021-04-14  6:20   ` [PATCH 8/9] generic/{094,225}: skip test when the xfs rt extent size is larger than 1 fsb Christoph Hellwig
2021-04-14  1:05 ` [PATCH 9/9] xfs/305: make sure that fsstress is still running when we quotaoff Darrick J. Wong
2021-04-14  6:21   ` Christoph Hellwig
2021-04-14 14:38     ` Darrick J. Wong
2021-04-20  6:21   ` Christoph Hellwig
2021-04-18 12:29 ` [PATCHSET 0/9] fstests: random fixes 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=161836232004.2754991.941115577343319256.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=guaneryu@gmail.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).