aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_dir2_priv.h
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-01-08 10:51:01 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2018-01-08 10:54:45 -0800
commit9101d3707b9acae8bbb0d82d47e99cf5c60b3ee5 (patch)
tree0f23dd51c97280d4b3519cde0057ec23682c3aec /fs/xfs/libxfs/xfs_dir2_priv.h
parentxfs: refactor short form btree pointer verification (diff)
downloadlinux-dev-9101d3707b9acae8bbb0d82d47e99cf5c60b3ee5.tar.xz
linux-dev-9101d3707b9acae8bbb0d82d47e99cf5c60b3ee5.zip
xfs: remove XFS_WANT_CORRUPTED_RETURN from dir3 data verifiers
Since __xfs_dir3_data_check verifies on-disk metadata, we can't have it noisily blowing asserts and hanging the system on corrupt data coming in off the disk. Instead, have it return a boolean like all the other checker functions, and only have it noisily fail if we fail in debug mode. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_dir2_priv.h')
-rw-r--r--fs/xfs/libxfs/xfs_dir2_priv.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2_priv.h b/fs/xfs/libxfs/xfs_dir2_priv.h
index 4badd26c47e6..45c68d04219d 100644
--- a/fs/xfs/libxfs/xfs_dir2_priv.h
+++ b/fs/xfs/libxfs/xfs_dir2_priv.h
@@ -39,12 +39,18 @@ extern int xfs_dir2_leaf_to_block(struct xfs_da_args *args,
/* xfs_dir2_data.c */
#ifdef DEBUG
-#define xfs_dir3_data_check(dp,bp) __xfs_dir3_data_check(dp, bp);
+#define xfs_dir3_data_check(dp, bp) \
+do { \
+ if (!__xfs_dir3_data_check((dp), (bp))) { \
+ XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, \
+ (bp)->b_target->bt_mount, (bp)->b_addr); \
+ } \
+} while (0)
#else
#define xfs_dir3_data_check(dp,bp)
#endif
-extern int __xfs_dir3_data_check(struct xfs_inode *dp, struct xfs_buf *bp);
+extern bool __xfs_dir3_data_check(struct xfs_inode *dp, struct xfs_buf *bp);
extern int xfs_dir3_data_read(struct xfs_trans *tp, struct xfs_inode *dp,
xfs_dablk_t bno, xfs_daddr_t mapped_bno, struct xfs_buf **bpp);
extern int xfs_dir3_data_readahead(struct xfs_inode *dp, xfs_dablk_t bno,