IB/srp: Don't wait for disconnection if sending DREQ fails
authorRoland Dreier <rolandd@cisco.com>
Wed, 17 May 2006 16:13:21 +0000 (09:13 -0700)
committerRoland Dreier <rolandd@cisco.com>
Wed, 17 May 2006 16:13:21 +0000 (09:13 -0700)
Sending a DREQ may fail, for example because the remote target has
already broken the connection.  If so, then SRP should not wait for
the disconnection to complete, because it never will.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/ulp/srp/ib_srp.c

index c32ce4348e1b817fd59c4c9425a07ca853881a49..351d66f3250d6936a3783c6130a7458477607184 100644 (file)
@@ -340,7 +340,10 @@ static void srp_disconnect_target(struct srp_target_port *target)
        /* 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);
 }