Loading fs/btrfs/scrub.c +7 −12 Original line number Original line Diff line number Diff line Loading @@ -250,8 +250,7 @@ static void scrub_recheck_block_checksum(struct btrfs_fs_info *fs_info, const u8 *csum, u64 generation, const u8 *csum, u64 generation, u16 csum_size); u16 csum_size); static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, struct scrub_block *sblock_good, struct scrub_block *sblock_good); int force_write); static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, struct scrub_block *sblock_good, struct scrub_block *sblock_good, int page_num, int force_write); int page_num, int force_write); Loading Loading @@ -1098,17 +1097,15 @@ static int scrub_handle_errored_block(struct scrub_block *sblock_to_check) sblock_other->no_io_error_seen) { sblock_other->no_io_error_seen) { if (sctx->is_dev_replace) { if (sctx->is_dev_replace) { scrub_write_block_to_dev_replace(sblock_other); scrub_write_block_to_dev_replace(sblock_other); goto corrected_error; } else { } else { int force_write = is_metadata || have_csum; ret = scrub_repair_block_from_good_copy( ret = scrub_repair_block_from_good_copy( sblock_bad, sblock_other, sblock_bad, sblock_other); force_write); if (!ret) } if (0 == ret) goto corrected_error; goto corrected_error; } } } } } /* /* * for dev_replace, pick good pages and write to the target device. * for dev_replace, pick good pages and write to the target device. Loading Loading @@ -1619,8 +1616,7 @@ static void scrub_recheck_block_checksum(struct btrfs_fs_info *fs_info, } } static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, struct scrub_block *sblock_good, struct scrub_block *sblock_good) int force_write) { { int page_num; int page_num; int ret = 0; int ret = 0; Loading @@ -1630,8 +1626,7 @@ static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, ret_sub = scrub_repair_page_from_good_copy(sblock_bad, ret_sub = scrub_repair_page_from_good_copy(sblock_bad, sblock_good, sblock_good, page_num, page_num, 1); force_write); if (ret_sub) if (ret_sub) ret = ret_sub; ret = ret_sub; } } Loading Loading
fs/btrfs/scrub.c +7 −12 Original line number Original line Diff line number Diff line Loading @@ -250,8 +250,7 @@ static void scrub_recheck_block_checksum(struct btrfs_fs_info *fs_info, const u8 *csum, u64 generation, const u8 *csum, u64 generation, u16 csum_size); u16 csum_size); static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, struct scrub_block *sblock_good, struct scrub_block *sblock_good); int force_write); static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, struct scrub_block *sblock_good, struct scrub_block *sblock_good, int page_num, int force_write); int page_num, int force_write); Loading Loading @@ -1098,17 +1097,15 @@ static int scrub_handle_errored_block(struct scrub_block *sblock_to_check) sblock_other->no_io_error_seen) { sblock_other->no_io_error_seen) { if (sctx->is_dev_replace) { if (sctx->is_dev_replace) { scrub_write_block_to_dev_replace(sblock_other); scrub_write_block_to_dev_replace(sblock_other); goto corrected_error; } else { } else { int force_write = is_metadata || have_csum; ret = scrub_repair_block_from_good_copy( ret = scrub_repair_block_from_good_copy( sblock_bad, sblock_other, sblock_bad, sblock_other); force_write); if (!ret) } if (0 == ret) goto corrected_error; goto corrected_error; } } } } } /* /* * for dev_replace, pick good pages and write to the target device. * for dev_replace, pick good pages and write to the target device. Loading Loading @@ -1619,8 +1616,7 @@ static void scrub_recheck_block_checksum(struct btrfs_fs_info *fs_info, } } static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, struct scrub_block *sblock_good, struct scrub_block *sblock_good) int force_write) { { int page_num; int page_num; int ret = 0; int ret = 0; Loading @@ -1630,8 +1626,7 @@ static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, ret_sub = scrub_repair_page_from_good_copy(sblock_bad, ret_sub = scrub_repair_page_from_good_copy(sblock_bad, sblock_good, sblock_good, page_num, page_num, 1); force_write); if (ret_sub) if (ret_sub) ret = ret_sub; ret = ret_sub; } } Loading