diff options
author | Stefan Behrens <sbehrens@giantdisaster.de> | 2012-03-30 07:58:31 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2012-04-18 13:22:36 -0400 |
commit | 5c84fc3c3914e9adfa6155a167c6c0c2709e6a62 (patch) | |
tree | b2ef30b7872dc9f31f621681169abaf4eb9e8205 | |
parent | 99ba55ad696944b37d5557bc5b4816890854fdb9 (diff) |
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>
-rw-r--r-- | fs/btrfs/scrub.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 60f0e28db31..b679bf68861 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c | |||
@@ -1258,12 +1258,6 @@ static int scrub_checksum_data(struct scrub_block *sblock) | |||
1258 | if (memcmp(csum, on_disk_csum, sdev->csum_size)) | 1258 | if (memcmp(csum, on_disk_csum, sdev->csum_size)) |
1259 | fail = 1; | 1259 | fail = 1; |
1260 | 1260 | ||
1261 | if (fail) { | ||
1262 | spin_lock(&sdev->stat_lock); | ||
1263 | ++sdev->stat.csum_errors; | ||
1264 | spin_unlock(&sdev->stat_lock); | ||
1265 | } | ||
1266 | |||
1267 | return fail; | 1261 | return fail; |
1268 | } | 1262 | } |
1269 | 1263 | ||
@@ -1336,15 +1330,6 @@ static int scrub_checksum_tree_block(struct scrub_block *sblock) | |||
1336 | if (memcmp(calculated_csum, on_disk_csum, sdev->csum_size)) | 1330 | if (memcmp(calculated_csum, on_disk_csum, sdev->csum_size)) |
1337 | ++crc_fail; | 1331 | ++crc_fail; |
1338 | 1332 | ||
1339 | if (crc_fail || fail) { | ||
1340 | spin_lock(&sdev->stat_lock); | ||
1341 | if (crc_fail) | ||
1342 | ++sdev->stat.csum_errors; | ||
1343 | if (fail) | ||
1344 | ++sdev->stat.verify_errors; | ||
1345 | spin_unlock(&sdev->stat_lock); | ||
1346 | } | ||
1347 | |||
1348 | return fail || crc_fail; | 1333 | return fail || crc_fail; |
1349 | } | 1334 | } |
1350 | 1335 | ||