[DRBD-cvs] svn commit by lars - r2496 - branches/drbd-0.7/drbd - fix list corruption respective resulting deadlock in re

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Tue Oct 3 16:41:58 CEST 2006


Author: lars
Date: 2006-10-03 16:41:57 +0200 (Tue, 03 Oct 2006)
New Revision: 2496

Modified:
   branches/drbd-0.7/drbd/drbd_main.c
   branches/drbd-0.7/drbd/drbd_receiver.c
Log:
fix list corruption respective resulting deadlock in receive_DataRequest

Modified: branches/drbd-0.7/drbd/drbd_main.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_main.c	2006-10-03 13:28:46 UTC (rev 2495)
+++ branches/drbd-0.7/drbd/drbd_main.c	2006-10-03 14:41:57 UTC (rev 2496)
@@ -538,11 +538,16 @@
 
 	spin_lock(&thi->t_lock);
 
-	/* INFO("%s [%d]: %s %d -> %d; %d\n",
+	/*
+	INFO("%s [%d]: %s[%s] %d -> %d; wait:%d; x->done:%d\n",
 	     current->comm, current->pid,
-	     thi->task ? thi->task->comm : "NULL", thi->t_state, ns, wait); */
+	     thi == &mdev->worker ? "worker" :
+	     thi == &mdev->asender ? "asender" :
+	     thi == &mdev->receiver ? "receiver" : "???",
+	     thi->task ? thi->task->comm : "NULL", thi->t_state, ns, wait,
+	     thi->startstop.done);
+	*/
 
-
 	if (thi->t_state == None) {
 		spin_unlock(&thi->t_lock);
 		return;

Modified: branches/drbd-0.7/drbd/drbd_receiver.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_receiver.c	2006-10-03 13:28:46 UTC (rev 2495)
+++ branches/drbd-0.7/drbd/drbd_receiver.c	2006-10-03 14:41:57 UTC (rev 2496)
@@ -1203,7 +1203,6 @@
 		return FALSE;
 	}
 	e->block_id = p->block_id; // no meaning on this side, pr* on partner
-	list_add(&e->w.list,&mdev->read_ee);
 	spin_unlock_irq(&mdev->ee_lock);
 
 	if(!inc_local(mdev) || (mdev->gen_cnt[Flags] & MDF_Consistent) == 0) {
@@ -1245,6 +1244,9 @@
 
 	mdev->read_cnt += size >> 9;
 	inc_unacked(mdev);
+	spin_lock_irq(&mdev->ee_lock);
+	list_add(&e->w.list,&mdev->read_ee);
+	spin_unlock_irq(&mdev->ee_lock);
 	drbd_generic_make_request(READ,&e->private_bio);
 	if (atomic_read(&mdev->local_cnt) >= (mdev->conf.max_epoch_size>>4) ) {
 		drbd_kick_lo(mdev);



More information about the drbd-cvs mailing list