summaryrefslogtreecommitdiffstats
path: root/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
diff options
context:
space:
mode:
authorVarun Prakash <varun@chelsio.com>2017-10-04 22:03:35 +0530
committerNicholas Bellinger <nab@linux-iscsi.org>2017-11-04 14:54:40 -0700
commit1ae01724ae92004be36a6c11c4d5a9f94e915204 (patch)
treeed241c8c2f26c6dbc38b8292f50e2b4423e0a6fd /drivers/target/iscsi/cxgbit/cxgbit_ddp.c
parentb849b4567549d5a54ab34ffacfd48fca05e8b34e (diff)
downloadlinux-1ae01724ae92004be36a6c11c4d5a9f94e915204.tar.bz2
cxgbit: Abort the TCP connection in case of data out timeout
If DDP is programmed for a WRITE cmd and data out timer gets expired then abort the TCP connection before freeing the cmd to avoid any possibility of DDP after freeing the cmd. Signed-off-by: Varun Prakash <varun@chelsio.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/iscsi/cxgbit/cxgbit_ddp.c')
-rw-r--r--drivers/target/iscsi/cxgbit/cxgbit_ddp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/target/iscsi/cxgbit/cxgbit_ddp.c b/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
index 5fdb57cac968..768cce0ccb80 100644
--- a/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
+++ b/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
@@ -275,6 +275,14 @@ void cxgbit_release_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd)
struct cxgbit_device *cdev = csk->com.cdev;
struct cxgbi_ppm *ppm = cdev2ppm(cdev);
+ /* Abort the TCP conn if DDP is not complete to
+ * avoid any possibility of DDP after freeing
+ * the cmd.
+ */
+ if (unlikely(cmd->write_data_done !=
+ cmd->se_cmd.data_length))
+ cxgbit_abort_conn(csk);
+
cxgbi_ppm_ppod_release(ppm, ttinfo->idx);
dma_unmap_sg(&ppm->pdev->dev, ttinfo->sgl,