linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ritesh Harjani <riteshh@linux.ibm.com>
To: fstests@vger.kernel.org
Cc: Eryu Guan <guan@eryu.me>,
	linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org,
	anju@linux.vnet.ibm.com, Ritesh Harjani <riteshh@linux.ibm.com>
Subject: [PATCHv2 2/2] generic/496: Add whitelisted FS support for swapon test
Date: Wed, 16 Dec 2020 10:47:25 +0530	[thread overview]
Message-ID: <17bc90bd450b1d3e8293397d15435a8c448d2b9a.1608094988.git.riteshh@linux.ibm.com> (raw)
In-Reply-To: <f161a49e6e3476d83c35b8e6a111644110ec4c8c.1608094988.git.riteshh@linux.ibm.com>

ext4, xfs should not fail swapon on fallocated file. Currently if this
fails the fstst was not returning a failure. Fix those for whitelisted
FS (for now added ext4/xfs).
There were some regressions which went unnoticed due to this in ext4
tree, which later got fixed as part of this patch [1]

[1]: https://patchwork.ozlabs.org/patch/1357275

Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
---
 tests/generic/496   | 16 +++++++++++++---
 tests/generic/group |  2 +-
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/tests/generic/496 b/tests/generic/496
index 805c6ac1c0ea..0546d8455491 100755
--- a/tests/generic/496
+++ b/tests/generic/496
@@ -5,7 +5,7 @@
 # FS QA Test No. 496
 #
 # Test various swapfile activation oddities on filesystems that support
-# fallocated swapfiles.
+# fallocated swapfiles (for whitelisted fs)
 #
 seq=`basename $0`
 seqres=$RESULT_DIR/$seq
@@ -61,8 +61,18 @@ touch $swapfile
 $CHATTR_PROG +C $swapfile >> $seqres.full 2>&1
 $XFS_IO_PROG -f -c "falloc 0 $len" $swapfile >> $seqres.full
 "$here/src/mkswap" $swapfile
-"$here/src/swapon" $swapfile >> $seqres.full 2>&1 || \
-	_notrun "fallocated swap not supported here"
+
+# ext4/xfs should not fail for swapon on fallocated files
+case $FSTYP in
+ext4|xfs)
+	"$here/src/swapon" $swapfile >> $seqres.full 2>&1 || \
+		_fail "swapon failed on fallocated file"
+	;;
+*)
+	"$here/src/swapon" $swapfile >> $seqres.full 2>&1 || \
+		_notrun "fallocated swap not supported here"
+	;;
+esac
 swapoff $swapfile

 # Create a fallocated swap file and touch every other $PAGE_SIZE to create
diff --git a/tests/generic/group b/tests/generic/group
index d8758d7f6a5f..7a7388d92ec6 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -498,7 +498,7 @@
 493 auto quick swap dedupe
 494 auto quick swap punch
 495 auto quick swap
-496 auto quick swap
+496 auto quick swap prealloc
 497 auto quick swap collapse
 498 auto quick log
 499 auto quick rw collapse zero
--
2.26.2


  reply	other threads:[~2020-12-16  5:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16  5:17 [PATCHv2 1/2] common/rc: Add whitelisted FS support in _require_scratch_swapfile() Ritesh Harjani
2020-12-16  5:17 ` Ritesh Harjani [this message]
2020-12-16  5:23 ` Ritesh Harjani
2020-12-20 15:39   ` Eryu Guan
2021-01-04 18:25     ` Darrick J. Wong
2021-01-05 11:00       ` Ritesh Harjani

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=17bc90bd450b1d3e8293397d15435a8c448d2b9a.1608094988.git.riteshh@linux.ibm.com \
    --to=riteshh@linux.ibm.com \
    --cc=anju@linux.vnet.ibm.com \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=linux-ext4@vger.kernel.org \
    --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).