[Sheepdog] [PATCH] sheep: avoid calling vdi_op_done() in worker threads

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Oct 19 10:40:19 CEST 2010


We cannot call vdi_op_done() in worker thread, so this patch moves it
to cpg_event_done().

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/group.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index 86cbdb8..096a328 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -905,9 +905,6 @@ static void __sd_deliver(struct cpg_event *cevent)
 		case SD_MSG_JOIN:
 			update_cluster_info((struct join_message *)m);
 			break;
-		case SD_MSG_VDI_OP:
-			vdi_op_done((struct vdi_op_message *)m);
-			break;
 		default:
 			eprintf("unknown message %d\n", m->op);
 			break;
@@ -1331,6 +1328,10 @@ static void cpg_event_done(struct work *work, int idx)
 	case CPG_EVENT_DELIVER:
 	{
 		struct work_deliver *w = container_of(cevent, struct work_deliver, cev);
+
+		if (w->msg->state == DM_FIN && w->msg->op == SD_MSG_VDI_OP)
+			vdi_op_done((struct vdi_op_message *)w->msg);
+
 		/*
 		 * if we are in the process of the JOIN, we will not
 		 * be suspended. So sd_deliver() links events to
-- 
1.5.6.5




More information about the sheepdog mailing list