aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/scrub/btree.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/xfs/scrub/btree.c b/fs/xfs/scrub/btree.c
index 6f94d1f7322d..117910db51b8 100644
--- a/fs/xfs/scrub/btree.c
+++ b/fs/xfs/scrub/btree.c
@@ -415,8 +415,17 @@ xchk_btree_check_owner(
415 struct xfs_btree_cur *cur = bs->cur; 415 struct xfs_btree_cur *cur = bs->cur;
416 struct check_owner *co; 416 struct check_owner *co;
417 417
418 if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && bp == NULL) 418 /*
419 * In theory, xfs_btree_get_block should only give us a null buffer
420 * pointer for the root of a root-in-inode btree type, but we need
421 * to check defensively here in case the cursor state is also screwed
422 * up.
423 */
424 if (bp == NULL) {
425 if (!(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE))
426 xchk_btree_set_corrupt(bs->sc, bs->cur, level);
419 return 0; 427 return 0;
428 }
420 429
421 /* 430 /*
422 * We want to cross-reference each btree block with the bnobt 431 * We want to cross-reference each btree block with the bnobt