aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/scrub/repair.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-02-06 10:20:54 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2019-02-11 16:07:01 -0800
commit9228d751ebf9c7876902db6458a33c26674f7ccc (patch)
treef95e10241beb983ea203c4da1b9483855c8abf0b /fs/xfs/scrub/repair.c
parentxfs: add magic numbers to dquot buffer ops (diff)
downloadlinux-dev-9228d751ebf9c7876902db6458a33c26674f7ccc.tar.xz
linux-dev-9228d751ebf9c7876902db6458a33c26674f7ccc.zip
xfs: use buf ops magic to detect btree block type
Now that we encode block magic numbers in all the buffer ops, use that for block type detection in the ag header repair code instead of encoding magics directly in the repair code. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/repair.c')
-rw-r--r--fs/xfs/scrub/repair.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
index 6acf1bfa0bfe..f28f4bad317b 100644
--- a/fs/xfs/scrub/repair.c
+++ b/fs/xfs/scrub/repair.c
@@ -743,7 +743,8 @@ xrep_findroot_block(
/* Ensure the block magic matches the btree type we're looking for. */
btblock = XFS_BUF_TO_BLOCK(bp);
- if (be32_to_cpu(btblock->bb_magic) != fab->magic)
+ ASSERT(fab->buf_ops->magic[1] != 0);
+ if (btblock->bb_magic != fab->buf_ops->magic[1])
goto out;
/*