[SCSI] libfc: release DDP context if frame_send() fails
authorYi Zou <yi.zou@intel.com>
Mon, 16 May 2011 23:45:40 +0000 (16:45 -0700)
committerJames Bottomley <jbottomley@parallels.com>
Tue, 24 May 2011 16:36:51 +0000 (12:36 -0400)
In case frame_send() fails, make sure to let the underlying HW release the DDP
context that has already been set up before calling frame_send().

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
drivers/scsi/libfc/fc_exch.c
drivers/scsi/libfc/fc_fcp.c
drivers/scsi/libfc/fc_libfc.h

index 77035a746f6027e5f232140349e7339c5901f2e9..4d2994d38fb986306d6aa6e676d5ce68842cef42 100644 (file)
@@ -1978,6 +1978,7 @@ static struct fc_seq *fc_exch_seq_send(struct fc_lport *lport,
        spin_unlock_bh(&ep->ex_lock);
        return sp;
 err:
+       fc_fcp_ddp_done(fr_fsp(fp));
        rc = fc_exch_done_locked(ep);
        spin_unlock_bh(&ep->ex_lock);
        if (!rc)
index 2a3a4720a771c26c4f67343f8b720ac005e1100f..f880d40d4e78120b1dd7c0b7cf8128dadf736f43 100644 (file)
@@ -312,7 +312,7 @@ void fc_fcp_ddp_setup(struct fc_fcp_pkt *fsp, u16 xid)
  *                    DDP related resources for a fcp_pkt
  * @fsp: The FCP packet that DDP had been used on
  */
-static void fc_fcp_ddp_done(struct fc_fcp_pkt *fsp)
+void fc_fcp_ddp_done(struct fc_fcp_pkt *fsp)
 {
        struct fc_lport *lport;
 
index fedc819d70c0259db4dceb8b04e797dd4c5fbd0b..c7d071289af5ac34320759d8ba0aa415fc644b64 100644 (file)
@@ -108,6 +108,7 @@ extern struct fc4_prov fc_rport_fcp_init;   /* FCP initiator provider */
  * Set up direct-data placement for this I/O request
  */
 void fc_fcp_ddp_setup(struct fc_fcp_pkt *fsp, u16 xid);
+void fc_fcp_ddp_done(struct fc_fcp_pkt *fsp);
 
 /*
  * Module setup functions