[PATCH v2] generic: disable dmlogwrites tests on XFS

Brian Foster
2020-08-27T14:53:47Z

Several generic fstests use dm-log-writes to test the filesystem for
consistency at various crash recovery points. dm-log-writes and the
associated replay mechanism rely on discard to clear stale blocks
when moving to various points in time of the fs. If the storage
doesn't provide discard zeroing or the discard requests exceed the
hardcoded maximum (128MB) of the fallback solution to physically
write zeroes, stale blocks are left around in the target fs. This
causes issues on XFS if recovery observes metadata from a future
version of an fs that has been replayed to an older point in time.
This corrupts the filesystem and leads to spurious test failures
that are nontrivial to diagnose.

Disable the generic dmlogwrites tests on XFS for the time being.
This is intended to be a temporary change until a solution is found
that allows these tests to predictably clear stale data while still
allowing them to run in a reasonable amount of time.

Signed-off-by: Brian Foster <bfoster@redhat.com>
---

v2:
- Drop all dmthinp changes. Unconditionally disable tests on XFS.
v1: https://lore.kernel.org/fstests/20200826143815.360002-2-bfoster@redhat.com/

common/dmlogwrites | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/common/dmlogwrites b/common/dmlogwrites
index 573f4b8a..b0a28ce8 100644
--- a/common/dmlogwrites
+++ b/common/dmlogwrites
@@ -9,6 +9,14 @@ _require_log_writes()
[ -z "$LOGWRITES_DEV" -o ! -b "$LOGWRITES_DEV" ] && \
_notrun "This test requires a valid \$LOGWRITES_DEV"

+ # The logwrites mechanism relies on discard to provide zeroing behavior
+ # to clear out stale filesystem content. Discard doesn't reliably
+ # provide this behavior, and this leads to spurious corruptions on XFS
+ # filesystems by leaving out of order metadata in the fs. We must
+ # disable dmlogwrites on XFS until it implements a predictable mechanism
+ # to clear stale data.
+ [ $FSTYP == "xfs" ] && _notrun "dmlogwrites not supported on XFS"
+
_exclude_scratch_mount_option dax
_require_dm_target log-writes
_require_test_program "log-writes/replay-log"
@@ -39,6 +47,8 @@ _require_log_writes_dax_mountopt()
[ -z "$LOGWRITES_DEV" -o ! -b "$LOGWRITES_DEV" ] && \
_notrun "This test requires a valid \$LOGWRITES_DEV"

+ [ $FSTYP == "xfs" ] && _notrun "dmlogwrites not supported on XFS"
+
_require_dm_target log-writes
_require_test_program "log-writes/replay-log"

--
2.25.4