aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_dir2_node.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/libxfs/xfs_dir2_node.c')
-rw-r--r--fs/xfs/libxfs/xfs_dir2_node.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2_node.c b/fs/xfs/libxfs/xfs_dir2_node.c
index f1bb3434f51c..3b03703c5c3d 100644
--- a/fs/xfs/libxfs/xfs_dir2_node.c
+++ b/fs/xfs/libxfs/xfs_dir2_node.c
@@ -87,20 +87,18 @@ xfs_dir3_free_verify(
87 struct xfs_mount *mp = bp->b_target->bt_mount; 87 struct xfs_mount *mp = bp->b_target->bt_mount;
88 struct xfs_dir2_free_hdr *hdr = bp->b_addr; 88 struct xfs_dir2_free_hdr *hdr = bp->b_addr;
89 89
90 if (!xfs_verify_magic(bp, hdr->magic))
91 return __this_address;
92
90 if (xfs_sb_version_hascrc(&mp->m_sb)) { 93 if (xfs_sb_version_hascrc(&mp->m_sb)) {
91 struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr; 94 struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr;
92 95
93 if (hdr3->magic != cpu_to_be32(XFS_DIR3_FREE_MAGIC))
94 return __this_address;
95 if (!uuid_equal(&hdr3->uuid, &mp->m_sb.sb_meta_uuid)) 96 if (!uuid_equal(&hdr3->uuid, &mp->m_sb.sb_meta_uuid))
96 return __this_address; 97 return __this_address;
97 if (be64_to_cpu(hdr3->blkno) != bp->b_bn) 98 if (be64_to_cpu(hdr3->blkno) != bp->b_bn)
98 return __this_address; 99 return __this_address;
99 if (!xfs_log_check_lsn(mp, be64_to_cpu(hdr3->lsn))) 100 if (!xfs_log_check_lsn(mp, be64_to_cpu(hdr3->lsn)))
100 return __this_address; 101 return __this_address;
101 } else {
102 if (hdr->magic != cpu_to_be32(XFS_DIR2_FREE_MAGIC))
103 return __this_address;
104 } 102 }
105 103
106 /* XXX: should bounds check the xfs_dir3_icfree_hdr here */ 104 /* XXX: should bounds check the xfs_dir3_icfree_hdr here */
@@ -151,6 +149,8 @@ xfs_dir3_free_write_verify(
151 149
152const struct xfs_buf_ops xfs_dir3_free_buf_ops = { 150const struct xfs_buf_ops xfs_dir3_free_buf_ops = {
153 .name = "xfs_dir3_free", 151 .name = "xfs_dir3_free",
152 .magic = { cpu_to_be32(XFS_DIR2_FREE_MAGIC),
153 cpu_to_be32(XFS_DIR3_FREE_MAGIC) },
154 .verify_read = xfs_dir3_free_read_verify, 154 .verify_read = xfs_dir3_free_read_verify,
155 .verify_write = xfs_dir3_free_write_verify, 155 .verify_write = xfs_dir3_free_write_verify,
156 .verify_struct = xfs_dir3_free_verify, 156 .verify_struct = xfs_dir3_free_verify,