patch-2.1.100 linux/drivers/block/raid5.c

Next file: linux/drivers/block/rd.c
Previous file: linux/drivers/block/qd6580.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.99/linux/drivers/block/raid5.c linux/drivers/block/raid5.c
@@ -1209,6 +1209,14 @@
 	sh->pd_idx = pd_idx;
 	if (sh->phase != PHASE_COMPLETE && sh->phase != PHASE_BEGIN)
 		PRINTK(("stripe %lu catching the bus!\n", sh->sector));
+	if (sh->bh_new[dd_idx]) {
+		printk("raid5: bug: stripe->bh_new[%d], sector %lu exists\n", dd_idx, sh->sector);
+		printk("raid5: bh %p, bh_new %p\n", bh, sh->bh_new[dd_idx]);
+		lock_stripe(sh);
+		md_wakeup_thread(raid_conf->thread);
+		wait_on_stripe(sh);
+		goto repeat;
+	}
 	add_stripe_bh(sh, bh, dd_idx, rw);
 
 	md_wakeup_thread(raid_conf->thread);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov