diff options
author | Brian Foster <bfoster@redhat.com> | 2017-02-13 22:48:17 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2017-02-16 17:19:15 -0800 |
commit | 9dbddd7b0c649bd6aa9442c717932325ec590303 (patch) | |
tree | 845033c1408edf5ba5f55032fda4859c07dab89c /fs/xfs/xfs_mount.h | |
parent | fa7f138ac4c70dc00519c124cf7cd4862a0a5b0e (diff) | |
download | linux-9dbddd7b0c649bd6aa9442c717932325ec590303.tar.gz linux-9dbddd7b0c649bd6aa9442c717932325ec590303.tar.bz2 linux-9dbddd7b0c649bd6aa9442c717932325ec590303.zip |
xfs: resurrect debug mode drop buffered writes mechanism
A debug mode write failure mechanism was introduced to XFS in commit
801cc4e17a ("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 68a9f5e700 ("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>
Diffstat (limited to 'fs/xfs/xfs_mount.h')
-rw-r--r-- | fs/xfs/xfs_mount.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 20e2981a4aec..6db6fd6b82b0 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -200,11 +200,12 @@ typedef struct xfs_mount { /* * DEBUG mode instrumentation to test and/or trigger delayed allocation * block killing in the event of failed writes. When enabled, all - * buffered writes are forced to fail. All delalloc blocks in the range - * of the write (including pre-existing delalloc blocks!) are tossed as - * part of the write failure error handling sequence. + * buffered writes are silenty dropped and handled as if they failed. + * All delalloc blocks in the range of the write (including pre-existing + * delalloc blocks!) are tossed as part of the write failure error + * handling sequence. */ - bool m_fail_writes; + bool m_drop_writes; #endif } xfs_mount_t; @@ -325,13 +326,13 @@ xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d) #ifdef DEBUG static inline bool -xfs_mp_fail_writes(struct xfs_mount *mp) +xfs_mp_drop_writes(struct xfs_mount *mp) { - return mp->m_fail_writes; + return mp->m_drop_writes; } #else static inline bool -xfs_mp_fail_writes(struct xfs_mount *mp) +xfs_mp_drop_writes(struct xfs_mount *mp) { return 0; } |