xfs
[Top] [All Lists]

[PATCH 06/13] libxfs: skip pointless CRC updates after verifier failures

To: xfs@xxxxxxxxxxx
Subject: [PATCH 06/13] libxfs: skip pointless CRC updates after verifier failures
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 4 Mar 2014 19:51:50 +1100
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1393923117-9559-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1393923117-9559-1-git-send-email-david@xxxxxxxxxxxxx>
From: Dave Chinner <dchinner@xxxxxxxxxx>

[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@xxxxxxxxxx>
---
 libxfs/xfs_alloc_btree.c  | 1 +
 libxfs/xfs_ialloc_btree.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/libxfs/xfs_alloc_btree.c b/libxfs/xfs_alloc_btree.c
index 282a320..5b38c24 100644
--- a/libxfs/xfs_alloc_btree.c
+++ b/libxfs/xfs_alloc_btree.c
@@ -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);
 
diff --git a/libxfs/xfs_ialloc_btree.c b/libxfs/xfs_ialloc_btree.c
index 27a5dd9..d9589b7 100644
--- a/libxfs/xfs_ialloc_btree.c
+++ b/libxfs/xfs_ialloc_btree.c
@@ -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);
 
-- 
1.9.0

<Prev in Thread] Current Thread [Next in Thread>