[openib-general] [PATCH] IB/ipoib - possible deadlock in path query and join

Eli Cohen eli at mellanox.co.il
Thu Oct 5 07:22:12 PDT 2006


When a path query or a join fails immediately, we want to
call complete(&obj->done). This is required to avoid a deadlock
that can occur if there is no farther attempt to the operation
(query or join) and a wait_for_completion() is called on obj->done
due to a flush operation.

Signed-off-by: Eli Cohen <eli at dev.mellanox.co.il>
---

Index: openib-1.1/drivers/infiniband/ulp/ipoib/ipoib_main.c
===================================================================
--- openib-1.1.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c	2006-10-05 09:09:27.000000000 +0200
+++ openib-1.1/drivers/infiniband/ulp/ipoib/ipoib_main.c	2006-10-05 09:12:00.000000000 +0200
@@ -504,6 +504,7 @@ static int path_rec_start(struct net_dev
 	if (path->query_id < 0) {
 		ipoib_warn(priv, "ib_sa_path_rec_get failed\n");
 		path->query = NULL;
+		complete(&path->done);
 		return path->query_id;
 	}
 
Index: openib-1.1/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
===================================================================
--- openib-1.1.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c	2006-10-05 09:09:23.000000000 +0200
+++ openib-1.1/drivers/infiniband/ulp/ipoib/ipoib_multicast.c	2006-10-05 12:23:25.000000000 +0200
@@ -371,6 +371,7 @@ static int ipoib_mcast_sendonly_join(str
 	if (ret < 0) {
 		ipoib_warn(priv, "ib_sa_mcmember_rec_set failed (ret = %d)\n",
 			   ret);
+		complete(&mcast->done);
 	} else {
 		ipoib_dbg_mcast(priv, "no multicast record for " IPOIB_GID_FMT
 				", starting join\n",
@@ -501,6 +502,7 @@ static void ipoib_mcast_join(struct net_
 
 	if (ret < 0) {
 		ipoib_warn(priv, "ib_sa_mcmember_rec_set failed, status %d\n", ret);
+		complete(&mcast->done);
 
 		mcast->backoff *= 2;
 		if (mcast->backoff > IPOIB_MAX_BACKOFF_SECONDS)





More information about the general mailing list