Skip to content

Commit

Permalink
Btrfs: don't count CRC or header errors twice while scrubbing
Browse files Browse the repository at this point in the history
Each CRC or header error was counted twice, this is now fixed.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
  • Loading branch information
Stefan Behrens authored and David Sterba committed Apr 18, 2012
1 parent 99ba55a commit 5c84fc3
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions fs/btrfs/scrub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1258,12 +1258,6 @@ static int scrub_checksum_data(struct scrub_block *sblock)
if (memcmp(csum, on_disk_csum, sdev->csum_size))
fail = 1;

if (fail) {
spin_lock(&sdev->stat_lock);
++sdev->stat.csum_errors;
spin_unlock(&sdev->stat_lock);
}

return fail;
}

Expand Down Expand Up @@ -1336,15 +1330,6 @@ static int scrub_checksum_tree_block(struct scrub_block *sblock)
if (memcmp(calculated_csum, on_disk_csum, sdev->csum_size))
++crc_fail;

if (crc_fail || fail) {
spin_lock(&sdev->stat_lock);
if (crc_fail)
++sdev->stat.csum_errors;
if (fail)
++sdev->stat.verify_errors;
spin_unlock(&sdev->stat_lock);
}

return fail || crc_fail;
}

Expand Down

0 comments on commit 5c84fc3

Please sign in to comment.