[openib-general] SRP: [PATCH] Releasing the scsi_host when unloading

Roland Dreier rdreier at cisco.com
Tue May 16 16:56:58 PDT 2006


BTW, I think the patch below is correct as well.  This avoids problems
where the SRP driver waits forever for a completion, for example if
sending the DREQ fails because the connection has already been
disconnected by the target.

Does this scenario seem like the deadlock you thought you saw?

--- linux-kernel/infiniband/ulp/srp/ib_srp.c	(revision 7245)
+++ linux-kernel/infiniband/ulp/srp/ib_srp.c	(working copy)
@@ -342,7 +342,10 @@ static void srp_disconnect_target(struct
 	/* XXX should send SRP_I_LOGOUT request */
 
 	init_completion(&target->done);
-	ib_send_cm_dreq(target->cm_id, NULL, 0);
+	if (ib_send_cm_dreq(target->cm_id, NULL, 0)) {
+		printk(KERN_DEBUG PFX "Sending CM DREQ failed\n");
+		return;
+	}
 	wait_for_completion(&target->done);
 }
 



More information about the general mailing list