From 2f889129de148b0ba2e1fbc9e9d33a4ef4c5f2cb Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 27 Mar 2006 01:18:19 -0800 Subject: [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 --- drivers/md/raid1.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/md') diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 04418e10d1d..3cb0872a845 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; -- cgit v1.2.3-70-g09d2