|
@@ -1299,7 +1299,9 @@ out:
|
|
static inline int scrub_nr_raid_mirrors(struct btrfs_bio *bbio, u64 *raid_map)
|
|
static inline int scrub_nr_raid_mirrors(struct btrfs_bio *bbio, u64 *raid_map)
|
|
{
|
|
{
|
|
if (raid_map) {
|
|
if (raid_map) {
|
|
- if (raid_map[bbio->num_stripes - 1] == RAID6_Q_STRIPE)
|
|
|
|
|
|
+ int real_stripes = bbio->num_stripes - bbio->num_tgtdevs;
|
|
|
|
+
|
|
|
|
+ if (raid_map[real_stripes - 1] == RAID6_Q_STRIPE)
|
|
return 3;
|
|
return 3;
|
|
else
|
|
else
|
|
return 2;
|
|
return 2;
|
|
@@ -1420,7 +1422,8 @@ leave_nomem:
|
|
|
|
|
|
scrub_stripe_index_and_offset(logical, raid_map,
|
|
scrub_stripe_index_and_offset(logical, raid_map,
|
|
mapped_length,
|
|
mapped_length,
|
|
- bbio->num_stripes,
|
|
|
|
|
|
+ bbio->num_stripes -
|
|
|
|
+ bbio->num_tgtdevs,
|
|
mirror_index,
|
|
mirror_index,
|
|
&stripe_index,
|
|
&stripe_index,
|
|
&stripe_offset);
|
|
&stripe_offset);
|