Commit c2414ad6 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: replace -EIO with -EFSCORRUPTED for corrupt metadata

There are a few places where we return -EIO instead of -EFSCORRUPTED
when we find corrupt metadata.  Fix those places.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
parent 04df34ac
...@@ -1375,7 +1375,7 @@ xfs_bmap_last_before( ...@@ -1375,7 +1375,7 @@ xfs_bmap_last_before(
case XFS_DINODE_FMT_EXTENTS: case XFS_DINODE_FMT_EXTENTS:
break; break;
default: default:
return -EIO; return -EFSCORRUPTED;
} }
if (!(ifp->if_flags & XFS_IFEXTENTS)) { if (!(ifp->if_flags & XFS_IFEXTENTS)) {
...@@ -1476,7 +1476,7 @@ xfs_bmap_last_offset( ...@@ -1476,7 +1476,7 @@ xfs_bmap_last_offset(
if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE && if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE &&
XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS)
return -EIO; return -EFSCORRUPTED;
error = xfs_bmap_last_extent(NULL, ip, whichfork, &rec, &is_empty); error = xfs_bmap_last_extent(NULL, ip, whichfork, &rec, &is_empty);
if (error || is_empty) if (error || is_empty)
...@@ -5869,7 +5869,7 @@ xfs_bmap_insert_extents( ...@@ -5869,7 +5869,7 @@ xfs_bmap_insert_extents(
del_cursor); del_cursor);
if (stop_fsb >= got.br_startoff + got.br_blockcount) { if (stop_fsb >= got.br_startoff + got.br_blockcount) {
error = -EIO; error = -EFSCORRUPTED;
goto del_cursor; goto del_cursor;
} }
......
...@@ -209,7 +209,7 @@ xfs_attr3_node_inactive( ...@@ -209,7 +209,7 @@ xfs_attr3_node_inactive(
*/ */
if (level > XFS_DA_NODE_MAXDEPTH) { if (level > XFS_DA_NODE_MAXDEPTH) {
xfs_trans_brelse(*trans, bp); /* no locks for later trans */ xfs_trans_brelse(*trans, bp); /* no locks for later trans */
return -EIO; return -EFSCORRUPTED;
} }
node = bp->b_addr; node = bp->b_addr;
...@@ -258,7 +258,7 @@ xfs_attr3_node_inactive( ...@@ -258,7 +258,7 @@ xfs_attr3_node_inactive(
error = xfs_attr3_leaf_inactive(trans, dp, child_bp); error = xfs_attr3_leaf_inactive(trans, dp, child_bp);
break; break;
default: default:
error = -EIO; error = -EFSCORRUPTED;
xfs_trans_brelse(*trans, child_bp); xfs_trans_brelse(*trans, child_bp);
break; break;
} }
...@@ -341,7 +341,7 @@ xfs_attr3_root_inactive( ...@@ -341,7 +341,7 @@ xfs_attr3_root_inactive(
error = xfs_attr3_leaf_inactive(trans, dp, bp); error = xfs_attr3_leaf_inactive(trans, dp, bp);
break; break;
default: default:
error = -EIO; error = -EFSCORRUPTED;
xfs_trans_brelse(*trans, bp); xfs_trans_brelse(*trans, bp);
break; break;
} }
......
...@@ -1126,7 +1126,7 @@ xfs_qm_dqflush( ...@@ -1126,7 +1126,7 @@ xfs_qm_dqflush(
xfs_buf_relse(bp); xfs_buf_relse(bp);
xfs_dqfunlock(dqp); xfs_dqfunlock(dqp);
xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
return -EIO; return -EFSCORRUPTED;
} }
/* This is the only portion of data that needs to persist */ /* This is the only portion of data that needs to persist */
......
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