aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_sb.c
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2014-03-13 04:12:33 -0400
committerDave Chinner <david@fromorbit.com>2014-03-13 04:12:33 -0400
commit49ae4b97d760d2e63394b96a7e14cbb43b9dc942 (patch)
tree628ea715021b8adce4f120965b40b47ff15d7b8c /fs/xfs/xfs_sb.c
parent730357a5cb72d9754a396a350653ff98a9e44783 (diff)
parentce5028cfe3ca48695b6a128638fe224426d37ebe (diff)
Merge branch 'xfs-verifier-cleanup' into for-next
Diffstat (limited to 'fs/xfs/xfs_sb.c')
-rw-r--r--fs/xfs/xfs_sb.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/xfs/xfs_sb.c b/fs/xfs/xfs_sb.c
index 75161a2060fb..0c0e41bbe4e3 100644
--- a/fs/xfs/xfs_sb.c
+++ b/fs/xfs/xfs_sb.c
@@ -611,12 +611,11 @@ xfs_sb_read_verify(
611 XFS_SB_VERSION_5) || 611 XFS_SB_VERSION_5) ||
612 dsb->sb_crc != 0)) { 612 dsb->sb_crc != 0)) {
613 613
614 if (!xfs_verify_cksum(bp->b_addr, BBTOB(bp->b_length), 614 if (!xfs_buf_verify_cksum(bp, XFS_SB_CRC_OFF)) {
615 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 = EFSBADCRC;
620 goto out_error; 619 goto out_error;
621 } 620 }
622 } 621 }
@@ -625,10 +624,9 @@ xfs_sb_read_verify(
625 624
626out_error: 625out_error:
627 if (error) { 626 if (error) {
628 if (error == EFSCORRUPTED)
629 XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW,
630 mp, bp->b_addr);
631 xfs_buf_ioerror(bp, error); 627 xfs_buf_ioerror(bp, error);
628 if (error == EFSCORRUPTED || error == EFSBADCRC)
629 xfs_verifier_error(bp);
632 } 630 }
633} 631}
634 632
@@ -663,9 +661,8 @@ xfs_sb_write_verify(
663 661
664 error = xfs_sb_verify(bp, false); 662 error = xfs_sb_verify(bp, false);
665 if (error) { 663 if (error) {
666 XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW,
667 mp, bp->b_addr);
668 xfs_buf_ioerror(bp, error); 664 xfs_buf_ioerror(bp, error);
665 xfs_verifier_error(bp);
669 return; 666 return;
670 } 667 }
671 668
@@ -675,8 +672,7 @@ xfs_sb_write_verify(
675 if (bip) 672 if (bip)
676 XFS_BUF_TO_SBP(bp)->sb_lsn = cpu_to_be64(bip->bli_item.li_lsn); 673 XFS_BUF_TO_SBP(bp)->sb_lsn = cpu_to_be64(bip->bli_item.li_lsn);
677 674
678 xfs_update_cksum(bp->b_addr, BBTOB(bp->b_length), 675 xfs_buf_update_cksum(bp, XFS_SB_CRC_OFF);
679 offsetof(struct xfs_sb, sb_crc));
680} 676}
681 677
682const struct xfs_buf_ops xfs_sb_buf_ops = { 678const struct xfs_buf_ops xfs_sb_buf_ops = {