xfs: test for log recovery failure after tail overwrite
authorBrian Foster <bfoster@redhat.com>
Wed, 2 Aug 2017 16:36:13 +0000 (12:36 -0400)
committerEryu Guan <eguan@redhat.com>
Fri, 18 Aug 2017 05:39:34 +0000 (13:39 +0800)
commit1cc5517771ed4ee133f71d06e1f5d62c22e8ae82
treec996b062a7801ffe3ae69e99e62e4006224531d1
parente4caca53e280741b8d18e54500a7ce8cbb25c097
xfs: test for log recovery failure after tail overwrite

XFS is susceptible to log recovery problems if the fs crashes under
certain circumstances. If the tail has been pinned for long enough
to the log to fill and the next batch of log buffer submissions
happen to fail, the filesystem shuts down having potentially
overwritten part of the range between the last good tail->head range
in the log. This causes log recovery to fail with crc mismatch or
invalid log record errors.

Add a test that uses XFS DEBUG mode error injection to force the
tail overwrite condition with a known bad (crc mismatch) log write
and tests that log recovery succeeds. Note that this problem is
currently only reproducible with larger (non-default) log buffer
sizes (i.e., '-o logbsize=256k') or smaller block sizes (1k).

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/xfs/057 [new file with mode: 0755]
tests/xfs/057.out [new file with mode: 0644]
tests/xfs/group