diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2019-02-06 19:20:54 +0100 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-02-12 01:07:01 +0100 |
commit | 9228d751ebf9c7876902db6458a33c26674f7ccc (patch) | |
tree | f95e10241beb983ea203c4da1b9483855c8abf0b /fs/xfs/scrub/repair.c | |
parent | xfs: add magic numbers to dquot buffer ops (diff) | |
download | linux-9228d751ebf9c7876902db6458a33c26674f7ccc.tar.xz linux-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.c | 3 |
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; /* |