diff options
author | Dave Chinner <dchinner@redhat.com> | 2012-11-12 06:54:12 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-11-15 22:34:41 -0500 |
commit | 82025d7f79148fe66a1594a0ebe4ab38152cf9e6 (patch) | |
tree | fb47428d6604ebb5f941d3f8c58e1de9d54a4b59 /fs/xfs/xfs_dir2_priv.h | |
parent | 20f7e9f3726a27cccade65c28265eef8ca50eecb (diff) |
xfs: verify dir2 block format buffers
Add a dir2 block format read verifier. To fully verify every block
when read, call xfs_dir2_data_check() on them. Change
xfs_dir2_data_check() to do runtime checking, convert ASSERT()
checks to XFS_WANT_CORRUPTED_RETURN(), which will trigger an ASSERT
failure on debug kernels, but on production kernels will dump an
error to dmesg and return EFSCORRUPTED to the caller.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_priv.h')
-rw-r--r-- | fs/xfs/xfs_dir2_priv.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/xfs/xfs_dir2_priv.h b/fs/xfs/xfs_dir2_priv.h index 3523d3e15aa8..93b8f66ae788 100644 --- a/fs/xfs/xfs_dir2_priv.h +++ b/fs/xfs/xfs_dir2_priv.h | |||
@@ -41,10 +41,12 @@ extern int xfs_dir2_leaf_to_block(struct xfs_da_args *args, | |||
41 | 41 | ||
42 | /* xfs_dir2_data.c */ | 42 | /* xfs_dir2_data.c */ |
43 | #ifdef DEBUG | 43 | #ifdef DEBUG |
44 | extern void xfs_dir2_data_check(struct xfs_inode *dp, struct xfs_buf *bp); | 44 | #define xfs_dir2_data_check(dp,bp) __xfs_dir2_data_check(dp, bp); |
45 | #else | 45 | #else |
46 | #define xfs_dir2_data_check(dp,bp) | 46 | #define xfs_dir2_data_check(dp,bp) |
47 | #endif | 47 | #endif |
48 | extern int __xfs_dir2_data_check(struct xfs_inode *dp, struct xfs_buf *bp); | ||
49 | |||
48 | extern struct xfs_dir2_data_free * | 50 | extern struct xfs_dir2_data_free * |
49 | xfs_dir2_data_freeinsert(struct xfs_dir2_data_hdr *hdr, | 51 | xfs_dir2_data_freeinsert(struct xfs_dir2_data_hdr *hdr, |
50 | struct xfs_dir2_data_unused *dup, int *loghead); | 52 | struct xfs_dir2_data_unused *dup, int *loghead); |