We should reset sblock->xxx_error stats before calling
scrub_recheck_block_checksum().
Current code run correctly because all sblock are allocated by
k[cz]alloc(), and the error stats are not got changed.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
sblock->no_io_error_seen = 1;
sblock->header_error = 0;
sblock->checksum_error = 0;
sblock->no_io_error_seen = 1;
sblock->header_error = 0;
sblock->checksum_error = 0;
+ sblock->generation_error = 0;
for (page_num = 0; page_num < sblock->page_count; page_num++) {
struct bio *bio;
for (page_num = 0; page_num < sblock->page_count; page_num++) {
struct bio *bio;
logical = sblock->pagev[0]->logical;
dev = sblock->pagev[0]->dev;
logical = sblock->pagev[0]->logical;
dev = sblock->pagev[0]->dev;
+ sblock->header_error = 0;
+ sblock->checksum_error = 0;
+ sblock->generation_error = 0;
if (sblock->no_io_error_seen) {
scrub_recheck_block_checksum(fs_info, sblock, is_metadata,
have_csum, csum, generation,
if (sblock->no_io_error_seen) {
scrub_recheck_block_checksum(fs_info, sblock, is_metadata,
have_csum, csum, generation,