]> err.no Git - linux-2.6/commitdiff
[PATCH] md: Restore 'remaining' count when retrying an write operation
authorNeilBrown <neilb@suse.de>
Mon, 27 Mar 2006 09:18:19 +0000 (01:18 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 27 Mar 2006 16:45:03 +0000 (08:45 -0800)
When retrying a write due to barrier failure, we don't reset 'remaining', so
it goes negative and never hits 0 again.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/raid1.c

index 04418e10d1dc6b52100567e6b833fcfbdf45a181..3cb0872a845d62f42caa0df01e2f7292571cc0a0 100644 (file)
@@ -1401,6 +1401,9 @@ static void raid1d(mddev_t *mddev)
                        int i;
                        clear_bit(R1BIO_BarrierRetry, &r1_bio->state);
                        clear_bit(R1BIO_Barrier, &r1_bio->state);
+                       for (i=0; i < conf->raid_disks; i++)
+                               if (r1_bio->bios[i])
+                                       atomic_inc(&r1_bio->remaining);
                        for (i=0; i < conf->raid_disks; i++)
                                if (r1_bio->bios[i]) {
                                        struct bio_vec *bvec;