fstests: fix overlay test failure over ext4
cover fstests: fix overlay test failure over ext4
Eryu,
As I reported earlier, test generic/009 was failing ./check -overlay run due to a test bug. The test belongs to a class of tests that have explicit check for a certain $FSTYP, which does not apply when FSTYP is overlay.
I ran all the tests that check for FSTYP = ext4 with overlay over ext4 and all the tests that check for FSTYP = xfs with overlay over xfs. generic/009 was the only test that failed because of the exlicit check. The rest of the tests either passes or did not run for a good reason.
Strangely, tests which _require_seek_data_hole(), that has the exact same check as generic/009 didn't fail with overlay over ext4. In fact, those tests also did not with with bare ext4 even when I removed the call to _ext4_disable_extent_zeroout() from _require_seek_data_hole()???
I tried to come up with a more generic solution, but didn't like any ideas I had, so I ended up fixing generic/009 in place in the hope that you either accept it as is or propose a better solution.
The fix depends on the user either setting FSTYP=ext4 in a config file or setting the variable OVL_BASE_FSTYP before running the test. I will soon send a patch for kvm-xfstests to Ted that does the latter.
Thanks,
Amir.
Amir Goldstein (2):
overlay: do not set OVL_BASE_FSTYP value to "overlay" generic/009: fix test failure with overlay over ext4
common/config | 2 +- tests/generic/009 | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
PATCH 1/2 overlay: do not set OVL_BASE_FSTYP value to "overlay"
The purpose of OVL_BASE_FSTYP is to store the value of FSTYP that is found in a host config file section.
When there is no host config file or if user sets FSTYP=overlay in config file, it makes no sense to store the value "overlay" in OVL_BASE_FSTYP and it is better to leave it empty or leave its current value in tact.
This allows user to set OVL_BASE_FSTYP in config file or before running the test to support queries about base fs, such as _require_metadata_journaling, even when running an overlay test.
--- common/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/config +1 -1
@@ -530,7 +530,7 @@ _overlay_config_override() [ -b "$TEST_DEV" ] || return 0 # Config file may specify base fs type, but we obay -overlay flag - export OVL_BASE_FSTYP="$FSTYP" + [ "$FSTYP" == overlay ] || export OVL_BASE_FSTYP="$FSTYP" export FSTYP=overlay # Store original base fs vars
Signature · 1 line
2.7.4
PATCH 2/2 generic/009: fix test failure with overlay over ext4
In reply to Amir GoldsteinWhen running test with overlayfs and ext4 as base fs, we need to disable extent zeroout on the underlying base fs.
---
Eryu,
Suggestions for a cleaner approach are welcome.
Thanks,
Amir.
tests/generic/009 | 3 +++ 1 file changed, 3 insertions(+)
tests/generic/009 +3 -0
@@ -39,6 +39,9 @@ testfile=$TEST_DIR/009.$$ if [ "$FSTYP" = "ext4" ]; then _ext4_disable_extent_zeroout fi +if [ "$FSTYP" = "overlay" -a "$OVL_BASE_FSTYP" = "ext4" ]; then + _ext4_disable_extent_zeroout "$OVL_BASE_TEST_DEV" +fi # When PAGE_SIZE > 4096 some filesystems extent layout is different so # it would not match the output.
Signature · 1 line
2.7.4
Re: [PATCH 2/2] generic/009: fix test failure with overlay over ext4
Quoted 9 lines · Amir Goldstein
When running test with overlayfs and ext4 as base fs, we need to disable extent zeroout on the underlying base fs.
Signed-off-by Amir Goldstein <[email protected]>---
Eryu,
Suggestions for a cleaner approach are welcome.
I thought about it too but came out with no better ideas, I think I'll just take your patches as-is.
Thanks,
Eryu
Quoted 24 lines
Thanks,
Amir.tests/generic/009 | 3 +++ 1 file changed, 3 insertions(+)tests/generic/009 +3
-0@@ -39,6 +39,9 @@ testfile=$TEST_DIR/009.$$ if [ "$FSTYP" = "ext4" ]; then _ext4_disable_extent_zeroout fi +if [ "$FSTYP" = "overlay" -a "$OVL_BASE_FSTYP" = "ext4" ]; then + _ext4_disable_extent_zeroout "$OVL_BASE_TEST_DEV" +fi # When PAGE_SIZE > 4096 some filesystems extent layout is different so # it would not match the output.Signature · 1 line
2.7.4