aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_sb.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_sb.c')
-rw-r--r--fs/xfs/xfs_sb.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/xfs/xfs_sb.c b/fs/xfs/xfs_sb.c
index b7c9aea77f8f..1e116794bb66 100644
--- a/fs/xfs/xfs_sb.c
+++ b/fs/xfs/xfs_sb.c
@@ -295,8 +295,7 @@ xfs_mount_validate_sb(
295 sbp->sb_dblocks == 0 || 295 sbp->sb_dblocks == 0 ||
296 sbp->sb_dblocks > XFS_MAX_DBLOCKS(sbp) || 296 sbp->sb_dblocks > XFS_MAX_DBLOCKS(sbp) ||
297 sbp->sb_dblocks < XFS_MIN_DBLOCKS(sbp))) { 297 sbp->sb_dblocks < XFS_MIN_DBLOCKS(sbp))) {
298 XFS_CORRUPTION_ERROR("SB sanity check failed", 298 xfs_notice(mp, "SB sanity check failed");
299 XFS_ERRLEVEL_LOW, mp, sbp);
300 return XFS_ERROR(EFSCORRUPTED); 299 return XFS_ERROR(EFSCORRUPTED);
301 } 300 }
302 301
@@ -611,10 +610,10 @@ xfs_sb_read_verify(
611 XFS_SB_VERSION_5) || 610 XFS_SB_VERSION_5) ||
612 dsb->sb_crc != 0)) { 611 dsb->sb_crc != 0)) {
613 612
614 if (!xfs_verify_cksum(bp->b_addr, be16_to_cpu(dsb->sb_sectsize), 613 if (!xfs_verify_cksum(bp->b_addr, BBTOB(bp->b_length),
615 offsetof(struct xfs_sb, sb_crc))) { 614 offsetof(struct xfs_sb, sb_crc))) {
616 /* Only fail bad secondaries on a known V5 filesystem */ 615 /* Only fail bad secondaries on a known V5 filesystem */
617 if (bp->b_bn != XFS_SB_DADDR && 616 if (bp->b_bn == XFS_SB_DADDR ||
618 xfs_sb_version_hascrc(&mp->m_sb)) { 617 xfs_sb_version_hascrc(&mp->m_sb)) {
619 error = EFSCORRUPTED; 618 error = EFSCORRUPTED;
620 goto out_error; 619 goto out_error;
@@ -625,7 +624,7 @@ xfs_sb_read_verify(
625 624
626out_error: 625out_error:
627 if (error) { 626 if (error) {
628 if (error != EWRONGFS) 627 if (error == EFSCORRUPTED)
629 XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, 628 XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW,
630 mp, bp->b_addr); 629 mp, bp->b_addr);
631 xfs_buf_ioerror(bp, error); 630 xfs_buf_ioerror(bp, error);
@@ -644,7 +643,6 @@ xfs_sb_quiet_read_verify(
644{ 643{
645 struct xfs_dsb *dsb = XFS_BUF_TO_SBP(bp); 644 struct xfs_dsb *dsb = XFS_BUF_TO_SBP(bp);
646 645
647
648 if (dsb->sb_magicnum == cpu_to_be32(XFS_SB_MAGIC)) { 646 if (dsb->sb_magicnum == cpu_to_be32(XFS_SB_MAGIC)) {
649 /* XFS filesystem, verify noisily! */ 647 /* XFS filesystem, verify noisily! */
650 xfs_sb_read_verify(bp); 648 xfs_sb_read_verify(bp);