xfs: skip pointless CRC updates after verifier failures
authorEric Sandeen <sandeen@redhat.com>
Thu, 27 Feb 2014 04:14:31 +0000 (15:14 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 27 Feb 2014 04:14:31 +0000 (15:14 +1100)
Most write verifiers don't update CRCs after the verifier
has failed and the buffer has been marked in error.  These
two didn't, but should.

Add returns to the verifier failure block, since the buffer
won't be written anyway.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_alloc_btree.c
fs/xfs/xfs_ialloc_btree.c

index 13085429e5234783c93e40c3a31492ec7d560428..144d3b0855fb21c5dee8aedef06c4837ebc57e07 100644 (file)
@@ -373,6 +373,7 @@ xfs_allocbt_write_verify(
                XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW,
                                     bp->b_target->bt_mount, bp->b_addr);
                xfs_buf_ioerror(bp, EFSCORRUPTED);
+               return;
        }
        xfs_btree_sblock_calc_crc(bp);
 
index c8fa5bbb36de3163b9fc798fc80025815f46182e..0028c50c1e2ba2aa2857af3dc1bb69a21028eb22 100644 (file)
@@ -261,6 +261,7 @@ xfs_inobt_write_verify(
                XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW,
                                     bp->b_target->bt_mount, bp->b_addr);
                xfs_buf_ioerror(bp, EFSCORRUPTED);
+               return;
        }
        xfs_btree_sblock_calc_crc(bp);