diff options
Diffstat (limited to 'fs/xfs/libxfs/xfs_ialloc_btree.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_ialloc_btree.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/xfs/libxfs/xfs_ialloc_btree.c b/fs/xfs/libxfs/xfs_ialloc_btree.c index 798269eb4767..c2df1f89eec8 100644 --- a/fs/xfs/libxfs/xfs_ialloc_btree.c +++ b/fs/xfs/libxfs/xfs_ialloc_btree.c | |||
@@ -260,6 +260,9 @@ xfs_inobt_verify( | |||
260 | xfs_failaddr_t fa; | 260 | xfs_failaddr_t fa; |
261 | unsigned int level; | 261 | unsigned int level; |
262 | 262 | ||
263 | if (!xfs_verify_magic(bp, block->bb_magic)) | ||
264 | return __this_address; | ||
265 | |||
263 | /* | 266 | /* |
264 | * During growfs operations, we can't verify the exact owner as the | 267 | * During growfs operations, we can't verify the exact owner as the |
265 | * perag is not fully initialised and hence not attached to the buffer. | 268 | * perag is not fully initialised and hence not attached to the buffer. |
@@ -270,18 +273,10 @@ xfs_inobt_verify( | |||
270 | * but beware of the landmine (i.e. need to check pag->pagi_init) if we | 273 | * but beware of the landmine (i.e. need to check pag->pagi_init) if we |
271 | * ever do. | 274 | * ever do. |
272 | */ | 275 | */ |
273 | switch (block->bb_magic) { | 276 | if (xfs_sb_version_hascrc(&mp->m_sb)) { |
274 | case cpu_to_be32(XFS_IBT_CRC_MAGIC): | ||
275 | case cpu_to_be32(XFS_FIBT_CRC_MAGIC): | ||
276 | fa = xfs_btree_sblock_v5hdr_verify(bp); | 277 | fa = xfs_btree_sblock_v5hdr_verify(bp); |
277 | if (fa) | 278 | if (fa) |
278 | return fa; | 279 | return fa; |
279 | /* fall through */ | ||
280 | case cpu_to_be32(XFS_IBT_MAGIC): | ||
281 | case cpu_to_be32(XFS_FIBT_MAGIC): | ||
282 | break; | ||
283 | default: | ||
284 | return __this_address; | ||
285 | } | 280 | } |
286 | 281 | ||
287 | /* level verification */ | 282 | /* level verification */ |
@@ -328,6 +323,7 @@ xfs_inobt_write_verify( | |||
328 | 323 | ||
329 | const struct xfs_buf_ops xfs_inobt_buf_ops = { | 324 | const struct xfs_buf_ops xfs_inobt_buf_ops = { |
330 | .name = "xfs_inobt", | 325 | .name = "xfs_inobt", |
326 | .magic = { cpu_to_be32(XFS_IBT_MAGIC), cpu_to_be32(XFS_IBT_CRC_MAGIC) }, | ||
331 | .verify_read = xfs_inobt_read_verify, | 327 | .verify_read = xfs_inobt_read_verify, |
332 | .verify_write = xfs_inobt_write_verify, | 328 | .verify_write = xfs_inobt_write_verify, |
333 | .verify_struct = xfs_inobt_verify, | 329 | .verify_struct = xfs_inobt_verify, |
@@ -335,6 +331,8 @@ const struct xfs_buf_ops xfs_inobt_buf_ops = { | |||
335 | 331 | ||
336 | const struct xfs_buf_ops xfs_finobt_buf_ops = { | 332 | const struct xfs_buf_ops xfs_finobt_buf_ops = { |
337 | .name = "xfs_finobt", | 333 | .name = "xfs_finobt", |
334 | .magic = { cpu_to_be32(XFS_FIBT_MAGIC), | ||
335 | cpu_to_be32(XFS_FIBT_CRC_MAGIC) }, | ||
338 | .verify_read = xfs_inobt_read_verify, | 336 | .verify_read = xfs_inobt_read_verify, |
339 | .verify_write = xfs_inobt_write_verify, | 337 | .verify_write = xfs_inobt_write_verify, |
340 | .verify_struct = xfs_inobt_verify, | 338 | .verify_struct = xfs_inobt_verify, |