diff --git a/[refs] b/[refs] index 29763f11c593..06d1fcc405a1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cb13ff69d6d61ab06285e3ef652f45ecda73e135 +refs/heads/master: 80b4812407c6b1f66a4f2430e69747a13f010839 diff --git a/trunk/drivers/md/raid10.c b/trunk/drivers/md/raid10.c index 1c2eb38f3c51..0138a727c1f3 100644 --- a/trunk/drivers/md/raid10.c +++ b/trunk/drivers/md/raid10.c @@ -1512,14 +1512,16 @@ static int _enough(struct r10conf *conf, struct geom *geo, int ignore) do { int n = conf->copies; int cnt = 0; + int this = first; while (n--) { - if (conf->mirrors[first].rdev && - first != ignore) + if (conf->mirrors[this].rdev && + this != ignore) cnt++; - first = (first+1) % geo->raid_disks; + this = (this+1) % geo->raid_disks; } if (cnt == 0) return 0; + first = (first + geo->near_copies) % geo->raid_disks; } while (first != 0); return 1; }