Skip to contentSkip to conversation

fstests: _require_metadata_journaling in _require_dm_flakey

RFC PATCH In review Eryu Guan 2 participants 3 messages Apr 3, 2015 – Apr 13, 2015

lore
Share & tools
lore

Eryu Guan

author
#0 lore raw

RFC PATCH 1/1 fstests: _require_metadata_journaling in _require_dm_flakey

Tests take use of dm-flakey target should require metadata journaling, so move _require_metadata_journaling call from each test to _require_dm_flakey to ease the process, though it seems unnecessary to btrfs or xfs specific tests.

This change also makes generic/039 generic/059 generic/325 require metadata journaling automatically, and any new test that calls _require_dm_flakey.

---
 common/rc         | 1 +
 tests/generic/034 | 1 -
 tests/generic/040 | 1 -
 tests/generic/041 | 1 -
 tests/generic/056 | 1 -
 tests/generic/057 | 1 -
 tests/generic/065 | 1 -
 tests/generic/066 | 1 -
 tests/generic/073 | 1 -
 tests/generic/311 | 1 -
 tests/generic/321 | 1 -
 tests/generic/322 | 1 -
 12 files changed, 1 insertion(+), 11 deletions(-)
common/rc +1 -0
index c5db0dd..518bf38 100644
@@ -1311,6 +1311,7 @@ _require_dm_flakey()
 {
     # require SCRATCH_DEV to be a valid block device
     _require_block_device $SCRATCH_DEV
+    _require_metadata_journaling $SCRATCH_DEV
     _require_command "$DMSETUP_PROG" dmsetup
 
     modprobe dm-flakey >/dev/null 2>&1
tests/generic/034 +0 -1
index 966b3d2..4ec1db8 100755
@@ -53,7 +53,6 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch
 _require_dm_flakey
-_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
tests/generic/040 +0 -1
index c841fbc..5f10f48 100755
@@ -62,7 +62,6 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch
 _require_dm_flakey
-_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
tests/generic/041 +0 -1
index f38b662..36a6f42 100755
@@ -66,7 +66,6 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch
 _require_dm_flakey
-_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
tests/generic/056 +0 -1
index 8bb1522..9ec00e3 100755
@@ -55,7 +55,6 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch
 _require_dm_flakey
-_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
tests/generic/057 +0 -1
index 3b9f89e..4c0ffd1 100755
@@ -55,7 +55,6 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch
 _require_dm_flakey
-_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
tests/generic/065 +0 -1
index 739a4d5..4fdff5a 100755
@@ -56,7 +56,6 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch
 _require_dm_flakey
-_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
tests/generic/066 +0 -1
index cb36506..3fbce8f 100755
@@ -61,7 +61,6 @@ _need_to_be_root
 _require_scratch
 _require_dm_flakey
 _require_attrs
-_require_metadata_journaling $SCRATCH_DEV
 
 _crash_and_mount()
 {
tests/generic/073 +0 -1
index 9cf0d90..bf666ec 100755
@@ -56,7 +56,6 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch
 _require_dm_flakey
-_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
tests/generic/311 +0 -1
index d21b6eb..85e52e8 100755
@@ -56,7 +56,6 @@ _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
tests/generic/321 +0 -1
index c821a23..3bd6b12 100755
@@ -45,7 +45,6 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch_nocheck
 _require_dm_flakey
-_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
tests/generic/322 +0 -1
index 4c0edf6..3ec2387 100755
@@ -45,7 +45,6 @@ _supported_os Linux
 _need_to_be_root
 _require_scratch_nocheck
 _require_dm_flakey
-_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
Signature · 1 line
2.1.0
#1 lore raw
Quoted 8 lines · Eryu Guan

Tests take use of dm-flakey target should require metadata journaling, so move _require_metadata_journaling call from each test to _require_dm_flakey to ease the process, though it seems unnecessary to btrfs or xfs specific tests.

This change also makes generic/039 generic/059 generic/325 require metadata journaling automatically, and any new test that calls _require_dm_flakey.

I'm not sure this is a great idea... I think _require_metadata_journaling should only be used when we expect filesystem consistency after a (flakey) shutdown. We can use dm_flakey to test fsync persistence on vfat, for example, right? But with this change such a test won't run on vfat or many other filesystems even though the test for persistent data would be perfectly valid.

-Eric

author
#2 lore raw
Quoted 10 lines · Eric Sandeen
Quoted 8 lines · Eryu Guan

Tests take use of dm-flakey target should require metadata journaling, so move _require_metadata_journaling call from each test to _require_dm_flakey to ease the process, though it seems unnecessary to btrfs or xfs specific tests.

This change also makes generic/039 generic/059 generic/325 require metadata journaling automatically, and any new test that calls _require_dm_flakey.

Quoted 8 lines

I'm not sure this is a great idea... I think _require_metadata_journaling should only be used when we expect filesystem consistency after a (flakey) shutdown. We can use dm_flakey to test fsync persistence on vfat, for example, right? But with this change such a test won't run on vfat or many other filesystems even though the test for persistent data would be perfectly valid.

-Eric

Yes, you're right. Thanks for pointing this out!

Then I think generic/039 generic/059 and generic/325 still need _require_metadata_journaling, I've seen generic/059 fail on ext2(using ext4 driver). I'll send another patch to fix these issues.

Thanks,
Eryu