[DRBD-cvs] svn commit by phil - r2493 - branches/drbd-0.7/drbd - Backportet one of the changes to the drbd_thread code f

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Tue Oct 3 14:07:49 CEST 2006


Author: phil
Date: 2006-10-03 14:07:48 +0200 (Tue, 03 Oct 2006)
New Revision: 2493

Modified:
   branches/drbd-0.7/drbd/drbd_main.c
Log:
Backportet one of the changes to the drbd_thread code from 8.0
to 7


Modified: branches/drbd-0.7/drbd/drbd_main.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_main.c	2006-10-03 11:31:08 UTC (rev 2492)
+++ branches/drbd-0.7/drbd/drbd_main.c	2006-10-03 12:07:48 UTC (rev 2493)
@@ -492,7 +492,6 @@
 	thi->t_lock  = SPIN_LOCK_UNLOCKED;
 	thi->task    = NULL;
 	thi->t_state = None;
-	init_completion(&thi->startstop);
 
 	thi->function = func;
 	thi->mdev = mdev;
@@ -513,6 +512,7 @@
 	     thi->t_state); */
 
 	if (thi->t_state == None) {
+		init_completion(&thi->startstop);
 		D_ASSERT(thi->task == NULL);
 		thi->t_state = Running;
 		spin_unlock(&thi->t_lock);
@@ -562,10 +562,10 @@
 
 		thi->t_state = ns;
 		smp_mb();
-		if (thi->task != current)
+		if (thi->task != current) {
+			if(wait) init_completion(&thi->startstop);
 			force_sig(DRBD_SIGKILL,thi->task);
-		else
-			D_ASSERT(!wait);
+		} else D_ASSERT(!wait);
 
 	}
 	spin_unlock(&thi->t_lock);



More information about the drbd-cvs mailing list