All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me,
	tytso@mit.edu, leah.rumancik@gmail.com
Subject: [PATCH 8/8] punch: skip fpunch tests when page size not congruent with file allocation unit
Date: Tue, 19 Jul 2022 14:38:01 -0700	[thread overview]
Message-ID: <165826668137.3249494.15114805008005901394.stgit@magnolia> (raw)
In-Reply-To: <165826663647.3249494.13640199673218669145.stgit@magnolia>

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

Skip the generic fpunch tests on a file when the file's allocation unit
size is not congruent with the system page size.  This is needed for
testing swapfiles and mmap collisions wiht fallocate.

Assuming this edgecase configuration of an edgecase feature is
vanishingly rare, let's just _notrun the tests instead of rewriting a
ton of tests to do their integrity checking by hand.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/generic/495 |    4 ++++
 tests/generic/503 |    4 ++++
 2 files changed, 8 insertions(+)


diff --git a/tests/generic/495 b/tests/generic/495
index 608f1715..5e03dfee 100755
--- a/tests/generic/495
+++ b/tests/generic/495
@@ -21,6 +21,10 @@ _require_sparse_files
 _scratch_mkfs >> $seqres.full 2>&1
 _scratch_mount
 
+blksize=$(_get_file_block_size $SCRATCH_MNT)
+test $blksize -eq $(getconf PAGE_SIZE) || \
+	_notrun "swap file allocation unit size must match page size"
+
 # We can't use _format_swapfile because we're using our custom mkswap and
 # swapon.
 touch "$SCRATCH_MNT/swap"
diff --git a/tests/generic/503 b/tests/generic/503
index a6971e63..ff3390bf 100755
--- a/tests/generic/503
+++ b/tests/generic/503
@@ -38,6 +38,10 @@ _scratch_mkfs >> $seqres.full 2>&1
 export MOUNT_OPTIONS=""
 _scratch_mount >> $seqres.full 2>&1
 
+blksize=$(_get_file_block_size $SCRATCH_MNT)
+test $blksize -eq $(getconf PAGE_SIZE) || \
+	_notrun "file block size must match page size"
+
 # real QA test starts here
 $here/src/t_mmap_collision $TEST_DIR/testfile $SCRATCH_MNT/testfile
 


  parent reply	other threads:[~2022-07-19 21:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19 21:37 [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Darrick J. Wong
2022-07-19 21:37 ` [PATCH 1/8] misc: use _get_file_block_size for block (re)mapping tests Darrick J. Wong
2022-07-19 21:37 ` [PATCH 2/8] misc: skip remap/fallocate tests when op length not congruent with file allocation unit Darrick J. Wong
2022-07-19 21:37 ` [PATCH 3/8] misc: skip extent size hint tests when hint " Darrick J. Wong
2022-07-19 21:37 ` [PATCH 4/8] misc: avoid tests encoding FIEMAP/BMAP golden output with weird file blocksizes Darrick J. Wong
2022-07-19 21:37 ` [PATCH 5/8] punch: use allocation unit to test punching holes Darrick J. Wong
2022-07-19 21:37 ` [PATCH 6/8] punch: skip fpunch tests when op length not congruent with file allocation unit Darrick J. Wong
2022-07-19 21:37 ` [PATCH 7/8] filter: report data block mappings and od offsets in multiples of allocation units Darrick J. Wong
2022-07-19 21:38 ` Darrick J. Wong [this message]
2022-07-24 14:01 ` [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Zorro Lang
2022-07-25 21:02   ` Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2022-07-13  0:56 [PATCHSET " Darrick J. Wong
2022-07-13  0:57 ` [PATCH 8/8] punch: skip fpunch tests when page size not congruent with file allocation unit Darrick J. Wong

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=165826668137.3249494.15114805008005901394.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=guaneryu@gmail.com \
    --cc=leah.rumancik@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=tytso@mit.edu \
    --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.