]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
xfs: replace -EIO with -EFSCORRUPTED for corrupt metadata
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 28 Oct 2019 23:12:34 +0000 (16:12 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 29 Oct 2019 16:50:11 +0000 (09:50 -0700)
There are a few places where we return -EIO instead of -EFSCORRUPTED
when we find corrupt metadata.  Fix those places.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/xfs_attr_inactive.c
fs/xfs/xfs_dquot.c

index 392a809c13e809782029013d70609f7d833fcf80..f16c6cdf2c582c6a729345ed96f1c362e303d9cf 100644 (file)
@@ -1375,7 +1375,7 @@ xfs_bmap_last_before(
        case XFS_DINODE_FMT_EXTENTS:
                break;
        default:
-               return -EIO;
+               return -EFSCORRUPTED;
        }
 
        if (!(ifp->if_flags & XFS_IFEXTENTS)) {
@@ -1476,7 +1476,7 @@ xfs_bmap_last_offset(
 
        if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE &&
            XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS)
-              return -EIO;
+               return -EFSCORRUPTED;
 
        error = xfs_bmap_last_extent(NULL, ip, whichfork, &rec, &is_empty);
        if (error || is_empty)
@@ -5869,7 +5869,7 @@ xfs_bmap_insert_extents(
                                del_cursor);
 
        if (stop_fsb >= got.br_startoff + got.br_blockcount) {
-               error = -EIO;
+               error = -EFSCORRUPTED;
                goto del_cursor;
        }
 
index a640a285cc52156a0dc1e42e72a9104bb7cdd623..f83f11d929e49969aae65c223bb0d9af439172b0 100644 (file)
@@ -209,7 +209,7 @@ xfs_attr3_node_inactive(
         */
        if (level > XFS_DA_NODE_MAXDEPTH) {
                xfs_trans_brelse(*trans, bp);   /* no locks for later trans */
-               return -EIO;
+               return -EFSCORRUPTED;
        }
 
        node = bp->b_addr;
@@ -258,7 +258,7 @@ xfs_attr3_node_inactive(
                        error = xfs_attr3_leaf_inactive(trans, dp, child_bp);
                        break;
                default:
-                       error = -EIO;
+                       error = -EFSCORRUPTED;
                        xfs_trans_brelse(*trans, child_bp);
                        break;
                }
@@ -341,7 +341,7 @@ xfs_attr3_root_inactive(
                error = xfs_attr3_leaf_inactive(trans, dp, bp);
                break;
        default:
-               error = -EIO;
+               error = -EFSCORRUPTED;
                xfs_trans_brelse(*trans, bp);
                break;
        }
index b924dbd63a7d56cb4bd97e95de1c15056a19d6c2..bcd4247b501496343967e1b7b2f0b5dab313aaef 100644 (file)
@@ -1126,7 +1126,7 @@ xfs_qm_dqflush(
                xfs_buf_relse(bp);
                xfs_dqfunlock(dqp);
                xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
-               return -EIO;
+               return -EFSCORRUPTED;
        }
 
        /* This is the only portion of data that needs to persist */