xfs: add a function to deal with corrupt buffers post-verifiers
Add a helper function to get rid of buffers that we have decided are corrupt after the verifiers have run. This function is intended to handle metadata checks that can't happen in the verifiers, such as inter-block relationship checking. Note that we now mark the buffer stale so that it will not end up on any LRU and will be purged on release. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
@@ -590,7 +590,7 @@ xfs_da3_split(
|
||||
node = oldblk->bp->b_addr;
|
||||
if (node->hdr.info.forw) {
|
||||
if (be32_to_cpu(node->hdr.info.forw) != addblk->blkno) {
|
||||
xfs_buf_corruption_error(oldblk->bp);
|
||||
xfs_buf_mark_corrupt(oldblk->bp);
|
||||
error = -EFSCORRUPTED;
|
||||
goto out;
|
||||
}
|
||||
@@ -603,7 +603,7 @@ xfs_da3_split(
|
||||
node = oldblk->bp->b_addr;
|
||||
if (node->hdr.info.back) {
|
||||
if (be32_to_cpu(node->hdr.info.back) != addblk->blkno) {
|
||||
xfs_buf_corruption_error(oldblk->bp);
|
||||
xfs_buf_mark_corrupt(oldblk->bp);
|
||||
error = -EFSCORRUPTED;
|
||||
goto out;
|
||||
}
|
||||
@@ -1624,7 +1624,7 @@ xfs_da3_node_lookup_int(
|
||||
}
|
||||
|
||||
if (magic != XFS_DA_NODE_MAGIC && magic != XFS_DA3_NODE_MAGIC) {
|
||||
xfs_buf_corruption_error(blk->bp);
|
||||
xfs_buf_mark_corrupt(blk->bp);
|
||||
return -EFSCORRUPTED;
|
||||
}
|
||||
|
||||
@@ -1639,7 +1639,7 @@ xfs_da3_node_lookup_int(
|
||||
|
||||
/* Tree taller than we can handle; bail out! */
|
||||
if (nodehdr.level >= XFS_DA_NODE_MAXDEPTH) {
|
||||
xfs_buf_corruption_error(blk->bp);
|
||||
xfs_buf_mark_corrupt(blk->bp);
|
||||
return -EFSCORRUPTED;
|
||||
}
|
||||
|
||||
@@ -1647,7 +1647,7 @@ xfs_da3_node_lookup_int(
|
||||
if (blkno == args->geo->leafblk)
|
||||
expected_level = nodehdr.level - 1;
|
||||
else if (expected_level != nodehdr.level) {
|
||||
xfs_buf_corruption_error(blk->bp);
|
||||
xfs_buf_mark_corrupt(blk->bp);
|
||||
return -EFSCORRUPTED;
|
||||
} else
|
||||
expected_level--;
|
||||
|
Reference in New Issue
Block a user