diff options
Diffstat (limited to 'fs/xfs/libxfs/xfs_dir2_data.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2_data.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2_data.c b/fs/xfs/libxfs/xfs_dir2_data.c index 01162c62ec8f..b7b9ce002cb9 100644 --- a/fs/xfs/libxfs/xfs_dir2_data.c +++ b/fs/xfs/libxfs/xfs_dir2_data.c | |||
@@ -252,18 +252,16 @@ xfs_dir3_data_verify( | |||
252 | struct xfs_mount *mp = bp->b_target->bt_mount; | 252 | struct xfs_mount *mp = bp->b_target->bt_mount; |
253 | struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr; | 253 | struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr; |
254 | 254 | ||
255 | if (!xfs_verify_magic(bp, hdr3->magic)) | ||
256 | return __this_address; | ||
257 | |||
255 | if (xfs_sb_version_hascrc(&mp->m_sb)) { | 258 | if (xfs_sb_version_hascrc(&mp->m_sb)) { |
256 | if (hdr3->magic != cpu_to_be32(XFS_DIR3_DATA_MAGIC)) | ||
257 | return __this_address; | ||
258 | if (!uuid_equal(&hdr3->uuid, &mp->m_sb.sb_meta_uuid)) | 259 | if (!uuid_equal(&hdr3->uuid, &mp->m_sb.sb_meta_uuid)) |
259 | return __this_address; | 260 | return __this_address; |
260 | if (be64_to_cpu(hdr3->blkno) != bp->b_bn) | 261 | if (be64_to_cpu(hdr3->blkno) != bp->b_bn) |
261 | return __this_address; | 262 | return __this_address; |
262 | if (!xfs_log_check_lsn(mp, be64_to_cpu(hdr3->lsn))) | 263 | if (!xfs_log_check_lsn(mp, be64_to_cpu(hdr3->lsn))) |
263 | return __this_address; | 264 | return __this_address; |
264 | } else { | ||
265 | if (hdr3->magic != cpu_to_be32(XFS_DIR2_DATA_MAGIC)) | ||
266 | return __this_address; | ||
267 | } | 265 | } |
268 | return __xfs_dir3_data_check(NULL, bp); | 266 | return __xfs_dir3_data_check(NULL, bp); |
269 | } | 267 | } |
@@ -339,6 +337,8 @@ xfs_dir3_data_write_verify( | |||
339 | 337 | ||
340 | const struct xfs_buf_ops xfs_dir3_data_buf_ops = { | 338 | const struct xfs_buf_ops xfs_dir3_data_buf_ops = { |
341 | .name = "xfs_dir3_data", | 339 | .name = "xfs_dir3_data", |
340 | .magic = { cpu_to_be32(XFS_DIR2_DATA_MAGIC), | ||
341 | cpu_to_be32(XFS_DIR3_DATA_MAGIC) }, | ||
342 | .verify_read = xfs_dir3_data_read_verify, | 342 | .verify_read = xfs_dir3_data_read_verify, |
343 | .verify_write = xfs_dir3_data_write_verify, | 343 | .verify_write = xfs_dir3_data_write_verify, |
344 | .verify_struct = xfs_dir3_data_verify, | 344 | .verify_struct = xfs_dir3_data_verify, |
@@ -346,6 +346,8 @@ const struct xfs_buf_ops xfs_dir3_data_buf_ops = { | |||
346 | 346 | ||
347 | static const struct xfs_buf_ops xfs_dir3_data_reada_buf_ops = { | 347 | static const struct xfs_buf_ops xfs_dir3_data_reada_buf_ops = { |
348 | .name = "xfs_dir3_data_reada", | 348 | .name = "xfs_dir3_data_reada", |
349 | .magic = { cpu_to_be32(XFS_DIR2_DATA_MAGIC), | ||
350 | cpu_to_be32(XFS_DIR3_DATA_MAGIC) }, | ||
349 | .verify_read = xfs_dir3_data_reada_verify, | 351 | .verify_read = xfs_dir3_data_reada_verify, |
350 | .verify_write = xfs_dir3_data_write_verify, | 352 | .verify_write = xfs_dir3_data_write_verify, |
351 | }; | 353 | }; |