[openib-general] [PATCH] cma: protect against adding device during destruction

Sean Hefty sean.hefty at intel.com
Fri Sep 1 12:37:28 PDT 2006


>I'll test some, but the problem hasn't reappeared since.
>The patch looks right, I'd say push it for 2.6.18.

We need the following change, which applies on top of the previous patch, as
well.

Add missing synchronization around acquiring an IB device.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
Index: cma.c
===================================================================
--- cma.c	(revision 9217)
+++ cma.c	(revision 9218)
@@ -1031,7 +1031,9 @@ static int cma_req_handler(struct ib_cm_
 	}
 
 	atomic_inc(&conn_id->dev_remove);
+	mutex_lock(&lock);
 	ret = cma_acquire_ib_dev(conn_id);
+	mutex_unlock(&lock);
 	if (ret) {
 		ret = -ENODEV;
 		cma_release_remove(conn_id);





More information about the general mailing list