# FS QA Test No. 496
#
# Test various swapfile activation oddities on filesystems that support
-# fallocated swapfiles.
+# fallocated swapfiles (for given fs ext4/xfs)
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
$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
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