]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
create _require_metadata_journaling, and add to tests that need it
authorEric Sandeen <sandeen@redhat.com>
Wed, 25 Feb 2015 04:36:52 +0000 (15:36 +1100)
committerDave Chinner <david@fromorbit.com>
Wed, 25 Feb 2015 04:36:52 +0000 (15:36 +1100)
Many tests use dm_flakey to trigger log replay, but for filesystems that
don't support metadata journaling, this causes failures when it shouldn't.
(i.e. we can hardly test log replay if there is no log, and the subsequent
filesystem check will turn up errors).

For some tests they actually sync everything we care about, and find
inconsistencies elsewhere, but I erred on the side of simply not running
the test in most cases.

Tested-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/rc
tests/generic/034
tests/generic/040
tests/generic/041
tests/generic/056
tests/generic/057
tests/generic/311
tests/generic/321
tests/generic/322

index f173eab2890696e3e5ed52a42e26250ba8afdf13..1ed9df53d07c82da14f21ee0ffba0eeb6d9eec96 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -2340,6 +2340,38 @@ _require_norecovery()
        _scratch_unmount
 }
 
+# Does this filesystem support metadata journaling?
+# We exclude ones here that don't; otherwise we assume that it does, so the
+# test will run, fail, and motivate someone to update this test for a new
+# filesystem.
+#
+# It's possible that TEST_DEV and SCRATCH_DEV have different features (it'd be
+# odd, but possible) so check $TEST_DEV by default, but we can optionall pass
+# any dev we want.
+_require_metadata_journaling()
+{
+       if [ -z $1 ]; then
+               DEV=$TEST_DEV
+       else
+               DEV=$1
+       fi
+
+       case "$FSTYP" in
+       ext2|vfat|msdos)
+               _notrun "$FSTYP does not support metadata journaling"
+               ;;
+       ext4)
+               # ext4 could be mkfs'd without a journal...
+               _require_dumpe2fs
+               $DUMPE2FS_PROG -h $DEV 2>&1 | grep -q has_journal || \
+                       _notrun "$FSTYP on $DEV not configured with metadata journaling"
+               ;;
+       *)
+               # by default we pass; if you need to, add your fs above!
+               ;;
+       esac
+}
+
 # Does fiemap support?
 _require_fiemap()
 {
index 4ec1db870578d7bfba27f9d401652be8f3a53a35..966b3d2f6fe05dcef1246785ff695d53cf958694 100755 (executable)
@@ -53,6 +53,7 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch
 _require_dm_flakey
+_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
index 5f10f4891734688def34fe15d5c4cb28580b9fd3..c841fbc2fa295546e1e698ac8a27607f01d3c01c 100755 (executable)
@@ -62,6 +62,7 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch
 _require_dm_flakey
+_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
index 36a6f423499903221bd4066bfcf765dee3e2f5a4..f38b6627707222cbaf16af641dc053120a0f913e 100755 (executable)
@@ -66,6 +66,7 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch
 _require_dm_flakey
+_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
index 9ec00e36e00e6412915ace74d2f5ad7c8cfbc3d7..8bb1522b67fc062e63b5c50869c5758e726a4ae6 100755 (executable)
@@ -55,6 +55,7 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch
 _require_dm_flakey
+_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
index 4c0ffd1ba8a2c82bdb650213a93ba6000866391f..3b9f89e29085cacf417ec73c1b14122e91ab5001 100755 (executable)
@@ -55,6 +55,7 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch
 _require_dm_flakey
+_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
index 85e52e8e008c7f5e89de9a85bc0e582e9a30fd63..d21b6eb35dd097f686674cb31ede3db38c4307fc 100755 (executable)
@@ -56,6 +56,7 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch_nocheck
 _require_dm_flakey
+_require_metadata_journaling $SCRATCH_DEV
 
 # xfs_io is not required for this test, but it's the best way to verify
 # the test system supports fallocate() for allocation
index 3bd6b1219ced5b7d66e11aa627f82a39bf14cce1..c821a23a3f6ca9d64b59a1620e1abc62823e092e 100755 (executable)
@@ -45,6 +45,7 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch_nocheck
 _require_dm_flakey
+_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
index 3ec23876aa2d87a20c735b1b627aee5cfb16cb94..4c0edf6a9563b19a58f385e0abc6cb678332b779 100755 (executable)
@@ -45,6 +45,7 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch_nocheck
 _require_dm_flakey
+_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full