Commit 56830d6c authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: check da node magic in _node_lookup_int

Before we start processing what we /think/ is a da3 node block, actually
check the magic to make sure that we're looking at a node block.  This
way we won't blow the asserts in _node_hdr_from_disk on corrupted
metadata.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarCarlos Maiolino <cmaiolino@redhat.com>
parent 611995db
...@@ -1523,8 +1523,10 @@ xfs_da3_node_lookup_int( ...@@ -1523,8 +1523,10 @@ xfs_da3_node_lookup_int(
break; break;
} }
blk->magic = XFS_DA_NODE_MAGIC; if (magic != XFS_DA_NODE_MAGIC && magic != XFS_DA3_NODE_MAGIC)
return -EFSCORRUPTED;
blk->magic = XFS_DA_NODE_MAGIC;
/* /*
* Search an intermediate node for a match. * Search an intermediate node for a match.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment