Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346677
b: refs/heads/master
c: cb2ced7
h: refs/heads/master
i:
  346675: 86ca4e6
v: v3
  • Loading branch information
Stefan Behrens authored and Josef Bacik committed Dec 12, 2012
1 parent 6c926db commit bd9be96
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a9e9987681198c56ac7f165725ca322d7a196e1
refs/heads/master: cb2ced73d8c7a38b5f699e267deadf2a2cfe911c
35 changes: 12 additions & 23 deletions trunk/fs/btrfs/scrub.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,26 +819,8 @@ static int scrub_handle_errored_block(struct scrub_block *sblock_to_check)

/*
* now build and submit the bios for the other mirrors, check
* checksums
*/
for (mirror_index = 0;
mirror_index < BTRFS_MAX_MIRRORS &&
sblocks_for_recheck[mirror_index].page_count > 0;
mirror_index++) {
if (mirror_index == failed_mirror_index)
continue;

/* build and submit the bios, check checksums */
ret = scrub_recheck_block(fs_info,
sblocks_for_recheck + mirror_index,
is_metadata, have_csum, csum,
generation, sctx->csum_size);
if (ret)
goto did_not_correct_error;
}

/*
* first try to pick the mirror which is completely without I/O
* checksums.
* First try to pick the mirror which is completely without I/O
* errors and also does not have a checksum error.
* If one is found, and if a checksum is present, the full block
* that is known to contain an error is rewritten. Afterwards
Expand All @@ -854,10 +836,17 @@ static int scrub_handle_errored_block(struct scrub_block *sblock_to_check)
mirror_index < BTRFS_MAX_MIRRORS &&
sblocks_for_recheck[mirror_index].page_count > 0;
mirror_index++) {
struct scrub_block *sblock_other = sblocks_for_recheck +
mirror_index;
struct scrub_block *sblock_other;

if (!sblock_other->header_error &&
if (mirror_index == failed_mirror_index)
continue;
sblock_other = sblocks_for_recheck + mirror_index;

/* build and submit the bios, check checksums */
ret = scrub_recheck_block(fs_info, sblock_other, is_metadata,
have_csum, csum, generation,
sctx->csum_size);
if (!ret && !sblock_other->header_error &&
!sblock_other->checksum_error &&
sblock_other->no_io_error_seen) {
int force_write = is_metadata || have_csum;
Expand Down

0 comments on commit bd9be96

Please sign in to comment.