]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: resurrect debug mode drop buffered writes mechanism
authorBrian Foster <bfoster@redhat.com>
Tue, 14 Feb 2017 06:48:17 +0000 (22:48 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Fri, 17 Feb 2017 01:19:15 +0000 (17:19 -0800)
commit795c406b847b4f48b1ed892820a74e8cf4c6c3b7
tree845033c1408edf5ba5f55032fda4859c07dab89c
parent19bd1f15c251b17fb7a343c20927f3209f60d6d6
xfs: resurrect debug mode drop buffered writes mechanism

A debug mode write failure mechanism was introduced to XFS in commit
bc7e2b05ce ("xfs: debug mode forced buffered write failure") to
facilitate targeted testing of delalloc indirect reservation management
from userspace. This code was subsequently rendered ineffective by the
move to iomap based buffered writes in commit 2868180707 ("xfs:
implement iomap based buffered write path"). This likely went unnoticed
because the associated userspace code had not made it into xfstests.

Resurrect this mechanism to facilitate effective indlen reservation
testing from xfstests. The move to iomap based buffered writes relocated
the hook this mechanism needs to return write failure from XFS to
generic code. The failure trigger must remain in XFS. Given that
limitation, convert this from a write failure mechanism to one that
simply drops writes without returning failure to userspace. Rename all
"fail_writes" references to "drop_writes" to illustrate the point. This
is more hacky than preferred, but still triggers the XFS error handling
behavior required to drive the indlen tests. This is only available in
DEBUG mode and for testing purposes only.

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_iomap.c
fs/xfs/xfs_mount.h
fs/xfs/xfs_sysfs.c