xfs: add log item pinning error injection tag
authorBrian Foster <bfoster@redhat.com>
Wed, 9 Aug 2017 01:21:52 +0000 (18:21 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 22 Aug 2017 16:22:24 +0000 (09:22 -0700)
commit7f4d01f36a3ac16f539f0fd3839de5d58fa4940f
treee564fe47a4384c36233cb1ac2cb9f87055fa234f
parent4a4f66eac4681378996a1837ad1ffec3a2e2981f
xfs: add log item pinning error injection tag

Add an error injection tag to force log items in the AIL to the
pinned state. This option can be used by test infrastructure to
induce head behind tail conditions. Specifically, this is intended
to be used by xfstests to reproduce log recovery problems after
failed/corrupted log writes overwrite the last good tail LSN in the
log.

When enabled, AIL push attempts see log items in the AIL in the
pinned state. This stalls metadata writeback and thus prevents the
current tail of the log from moving forward. When disabled,
subsequent AIL pushes observe the log items in their appropriate
state and filesystem operation continues as normal.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_error.c
fs/xfs/xfs_error.h
fs/xfs/xfs_trans_ail.c