]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: skip pointless CRC updates after verifier failures
authorDave Chinner <dchinner@redhat.com>
Thu, 6 Mar 2014 23:25:17 +0000 (10:25 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 6 Mar 2014 23:25:17 +0000 (10:25 +1100)
[userspace port]

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: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/xfs_alloc_btree.c
libxfs/xfs_ialloc_btree.c

index 282a3202c70f36781cadc727d10a116a268a2efc..5b38c24f1ad3b466b7c87feae66fa28f9c9a9e92 100644 (file)
@@ -355,6 +355,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 27a5dd99d146cc8d8b2113ce9f4cd01550195446..d9589b7d0c9cd28ccfe817b6634ef4b598f8eebf 100644 (file)
@@ -242,6 +242,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);