Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274701
b: refs/heads/master
c: 193ea74
h: refs/heads/master
i:
  274699: 87b604c
v: v3
  • Loading branch information
Jan Schmidt committed Sep 29, 2011
1 parent f093788 commit 1507893
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 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: 558540c17771eaf89b1a3be39aa2c8bc837da1a6
refs/heads/master: 193ea74b2729e6ddc08fb6bde6e15a3bd4d94071
12 changes: 6 additions & 6 deletions trunk/fs/btrfs/scrub.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ static void scrub_fixup(struct scrub_bio *sbio, int ix)
* first find a good copy
*/
for (i = 0; i < multi->num_stripes; ++i) {
if (i == sbio->spag[ix].mirror_num)
if (i + 1 == sbio->spag[ix].mirror_num)
continue;

if (scrub_fixup_io(READ, multi->stripes[i].dev->bdev,
Expand Down Expand Up @@ -930,21 +930,21 @@ static noinline_for_stack int scrub_stripe(struct scrub_dev *sdev,
if (map->type & BTRFS_BLOCK_GROUP_RAID0) {
offset = map->stripe_len * num;
increment = map->stripe_len * map->num_stripes;
mirror_num = 0;
mirror_num = 1;
} else if (map->type & BTRFS_BLOCK_GROUP_RAID10) {
int factor = map->num_stripes / map->sub_stripes;
offset = map->stripe_len * (num / map->sub_stripes);
increment = map->stripe_len * factor;
mirror_num = num % map->sub_stripes;
mirror_num = num % map->sub_stripes + 1;
} else if (map->type & BTRFS_BLOCK_GROUP_RAID1) {
increment = map->stripe_len;
mirror_num = num % map->num_stripes;
mirror_num = num % map->num_stripes + 1;
} else if (map->type & BTRFS_BLOCK_GROUP_DUP) {
increment = map->stripe_len;
mirror_num = num % map->num_stripes;
mirror_num = num % map->num_stripes + 1;
} else {
increment = map->stripe_len;
mirror_num = 0;
mirror_num = 1;
}

path = btrfs_alloc_path();
Expand Down

0 comments on commit 1507893

Please sign in to comment.