xfs: rework the inline directory verifiers
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 28 Mar 2017 21:51:10 +0000 (14:51 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 28 Mar 2017 21:51:10 +0000 (14:51 -0700)
commit005c5db8fd7b2c9fc0b8055fa824ecaa7b15d1bf
tree79ba07b0a639b449e5ea8579be794c4569d3e162
parentc02ed2e75ef4c74e41e421acb4ef1494671585e8
xfs: rework the inline directory verifiers

The inline directory verifiers should be called on the inode fork data,
which means after iformat_local on the read side, and prior to
ifork_flush on the write side.  This makes the fork verifier more
consistent with the way buffer verifiers work -- i.e. they will operate
on the memory buffer that the code will be reading and writing directly.

Furthermore, revise the verifier function to return -EFSCORRUPTED so
that we don't flood the logs with corruption messages and assert
notices.  This has been a particular problem with xfs/348, which
triggers the XFS_WANT_CORRUPTED_RETURN assertions, which halts the
kernel when CONFIG_XFS_DEBUG=y.  Disk corruption isn't supposed to do
that, at least not in a verifier.

Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
v2: get the inode d_ops the proper way
v3: describe the bug that this patch fixes; no code changes
fs/xfs/libxfs/xfs_dir2_priv.h
fs/xfs/libxfs/xfs_dir2_sf.c
fs/xfs/libxfs/xfs_inode_fork.c
fs/xfs/libxfs/xfs_inode_fork.h
fs/xfs/xfs_inode.c