aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_attr_leaf.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/libxfs/xfs_attr_leaf.c')
-rw-r--r--fs/xfs/libxfs/xfs_attr_leaf.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
index e60eba7f129c..f164f296f1b8 100644
--- a/fs/xfs/libxfs/xfs_attr_leaf.c
+++ b/fs/xfs/libxfs/xfs_attr_leaf.c
@@ -248,21 +248,18 @@ xfs_attr3_leaf_verify(
248 248
249 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf); 249 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
250 250
251 if (!xfs_verify_magic(bp, leaf->hdr.info.magic))
252 return __this_address;
253
251 if (xfs_sb_version_hascrc(&mp->m_sb)) { 254 if (xfs_sb_version_hascrc(&mp->m_sb)) {
252 struct xfs_da3_node_hdr *hdr3 = bp->b_addr; 255 struct xfs_da3_node_hdr *hdr3 = bp->b_addr;
253 256
254 if (hdr3->info.hdr.magic != cpu_to_be16(XFS_ATTR3_LEAF_MAGIC))
255 return __this_address;
256
257 if (!uuid_equal(&hdr3->info.uuid, &mp->m_sb.sb_meta_uuid)) 257 if (!uuid_equal(&hdr3->info.uuid, &mp->m_sb.sb_meta_uuid))
258 return __this_address; 258 return __this_address;
259 if (be64_to_cpu(hdr3->info.blkno) != bp->b_bn) 259 if (be64_to_cpu(hdr3->info.blkno) != bp->b_bn)
260 return __this_address; 260 return __this_address;
261 if (!xfs_log_check_lsn(mp, be64_to_cpu(hdr3->info.lsn))) 261 if (!xfs_log_check_lsn(mp, be64_to_cpu(hdr3->info.lsn)))
262 return __this_address; 262 return __this_address;
263 } else {
264 if (leaf->hdr.info.magic != cpu_to_be16(XFS_ATTR_LEAF_MAGIC))
265 return __this_address;
266 } 263 }
267 /* 264 /*
268 * In recovery there is a transient state where count == 0 is valid 265 * In recovery there is a transient state where count == 0 is valid
@@ -369,6 +366,8 @@ xfs_attr3_leaf_read_verify(
369 366
370const struct xfs_buf_ops xfs_attr3_leaf_buf_ops = { 367const struct xfs_buf_ops xfs_attr3_leaf_buf_ops = {
371 .name = "xfs_attr3_leaf", 368 .name = "xfs_attr3_leaf",
369 .magic = { cpu_to_be16(XFS_ATTR_LEAF_MAGIC),
370 cpu_to_be16(XFS_ATTR3_LEAF_MAGIC) },
372 .verify_read = xfs_attr3_leaf_read_verify, 371 .verify_read = xfs_attr3_leaf_read_verify,
373 .verify_write = xfs_attr3_leaf_write_verify, 372 .verify_write = xfs_attr3_leaf_write_verify,
374 .verify_struct = xfs_attr3_leaf_verify, 373 .verify_struct = xfs_attr3_leaf_verify,