From: NeilBrown Date: Mon, 27 Mar 2006 09:18:19 +0000 (-0800) Subject: [PATCH] md: Restore 'remaining' count when retrying an write operation X-Git-Tag: v2.6.17-rc1~279 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f889129de148b0ba2e1fbc9e9d33a4ef4c5f2cb;p=linux-2.6 [PATCH] md: Restore 'remaining' count when retrying an write operation 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 04418e10d1..3cb0872a84 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -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;