diff options
-rw-r--r-- | fs/xfs/xfs_mount.c | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_symlink.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_trans_buf.c | 11 |
3 files changed, 18 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 02df7b408a26..5c670f55ef07 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -307,6 +307,9 @@ reread: | |||
307 | error = bp->b_error; | 307 | error = bp->b_error; |
308 | if (loud) | 308 | if (loud) |
309 | xfs_warn(mp, "SB validate failed with error %d.", error); | 309 | xfs_warn(mp, "SB validate failed with error %d.", error); |
310 | /* bad CRC means corrupted metadata */ | ||
311 | if (error == EFSBADCRC) | ||
312 | error = EFSCORRUPTED; | ||
310 | goto release_buf; | 313 | goto release_buf; |
311 | } | 314 | } |
312 | 315 | ||
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c index 14e58f2c96bd..5fda18919d3b 100644 --- a/fs/xfs/xfs_symlink.c +++ b/fs/xfs/xfs_symlink.c | |||
@@ -80,6 +80,10 @@ xfs_readlink_bmap( | |||
80 | if (error) { | 80 | if (error) { |
81 | xfs_buf_ioerror_alert(bp, __func__); | 81 | xfs_buf_ioerror_alert(bp, __func__); |
82 | xfs_buf_relse(bp); | 82 | xfs_buf_relse(bp); |
83 | |||
84 | /* bad CRC means corrupted metadata */ | ||
85 | if (error == EFSBADCRC) | ||
86 | error = EFSCORRUPTED; | ||
83 | goto out; | 87 | goto out; |
84 | } | 88 | } |
85 | byte_cnt = XFS_SYMLINK_BUF_SPACE(mp, byte_cnt); | 89 | byte_cnt = XFS_SYMLINK_BUF_SPACE(mp, byte_cnt); |
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c index 647b6f1d8923..b8eef0549f3f 100644 --- a/fs/xfs/xfs_trans_buf.c +++ b/fs/xfs/xfs_trans_buf.c | |||
@@ -275,6 +275,10 @@ xfs_trans_read_buf_map( | |||
275 | XFS_BUF_UNDONE(bp); | 275 | XFS_BUF_UNDONE(bp); |
276 | xfs_buf_stale(bp); | 276 | xfs_buf_stale(bp); |
277 | xfs_buf_relse(bp); | 277 | xfs_buf_relse(bp); |
278 | |||
279 | /* bad CRC means corrupted metadata */ | ||
280 | if (error == EFSBADCRC) | ||
281 | error = EFSCORRUPTED; | ||
278 | return error; | 282 | return error; |
279 | } | 283 | } |
280 | #ifdef DEBUG | 284 | #ifdef DEBUG |
@@ -338,6 +342,9 @@ xfs_trans_read_buf_map( | |||
338 | if (tp->t_flags & XFS_TRANS_DIRTY) | 342 | if (tp->t_flags & XFS_TRANS_DIRTY) |
339 | xfs_force_shutdown(tp->t_mountp, | 343 | xfs_force_shutdown(tp->t_mountp, |
340 | SHUTDOWN_META_IO_ERROR); | 344 | SHUTDOWN_META_IO_ERROR); |
345 | /* bad CRC means corrupted metadata */ | ||
346 | if (error == EFSBADCRC) | ||
347 | error = EFSCORRUPTED; | ||
341 | return error; | 348 | return error; |
342 | } | 349 | } |
343 | } | 350 | } |
@@ -375,6 +382,10 @@ xfs_trans_read_buf_map( | |||
375 | if (tp->t_flags & XFS_TRANS_DIRTY) | 382 | if (tp->t_flags & XFS_TRANS_DIRTY) |
376 | xfs_force_shutdown(tp->t_mountp, SHUTDOWN_META_IO_ERROR); | 383 | xfs_force_shutdown(tp->t_mountp, SHUTDOWN_META_IO_ERROR); |
377 | xfs_buf_relse(bp); | 384 | xfs_buf_relse(bp); |
385 | |||
386 | /* bad CRC means corrupted metadata */ | ||
387 | if (error == EFSBADCRC) | ||
388 | error = EFSCORRUPTED; | ||
378 | return error; | 389 | return error; |
379 | } | 390 | } |
380 | #ifdef DEBUG | 391 | #ifdef DEBUG |