]> git.hungrycats.org Git - linux/commitdiff
[PATCH] md: fix BUG in raid5 resync code.
authorNeil Brown <neilb@cse.unsw.edu.au>
Sat, 5 Jun 2004 03:58:28 +0000 (20:58 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 5 Jun 2004 03:58:28 +0000 (20:58 -0700)
This condtion on this loop is primarily to avoid the loop if it doesn't
appear to be needed.  However it optimises a little too much and there is a
case where it skips the loop when it is really needed.  This patch fixes
it.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/raid5.c

index 6d93f0bc63dddbc3ef4eb31e2f20fd43aa729baf..773f9bfe78fa3709f13fff9b3024413bf3aa2655 100644 (file)
@@ -1037,7 +1037,7 @@ static void handle_stripe(struct stripe_head *sh)
         * parity, or to satisfy requests
         * or to load a block that is being partially written.
         */
-       if (to_read || non_overwrite || (syncing && (uptodate+failed < disks))) {
+       if (to_read || non_overwrite || (syncing && (uptodate < disks))) {
                for (i=disks; i--;) {
                        dev = &sh->dev[i];
                        if (!test_bit(R5_LOCKED, &dev->flags) && !test_bit(R5_UPTODATE, &dev->flags) &&