Btrfs: don't count CRC or header errors twice while scrubbing
Each CRC or header error was counted twice, this is now fixed. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
This commit is contained in:
committed by
David Sterba
parent
99ba55ad69
commit
5c84fc3c39
@@ -1258,12 +1258,6 @@ static int scrub_checksum_data(struct scrub_block *sblock)
|
|||||||
if (memcmp(csum, on_disk_csum, sdev->csum_size))
|
if (memcmp(csum, on_disk_csum, sdev->csum_size))
|
||||||
fail = 1;
|
fail = 1;
|
||||||
|
|
||||||
if (fail) {
|
|
||||||
spin_lock(&sdev->stat_lock);
|
|
||||||
++sdev->stat.csum_errors;
|
|
||||||
spin_unlock(&sdev->stat_lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fail;
|
return fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1336,15 +1330,6 @@ static int scrub_checksum_tree_block(struct scrub_block *sblock)
|
|||||||
if (memcmp(calculated_csum, on_disk_csum, sdev->csum_size))
|
if (memcmp(calculated_csum, on_disk_csum, sdev->csum_size))
|
||||||
++crc_fail;
|
++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;
|
return fail || crc_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user