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: v5.15~56392 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=2f889129de148b0ba2e1fbc9e9d33a4ef4c5f2cb;p=mirror_ubuntu-kernels.git [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 04418e10d1dc..3cb0872a845d 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;