diff options
author | Varun Prakash <varun@chelsio.com> | 2017-10-04 22:03:35 +0530 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2017-11-04 14:54:40 -0700 |
commit | 1ae01724ae92004be36a6c11c4d5a9f94e915204 (patch) | |
tree | ed241c8c2f26c6dbc38b8292f50e2b4423e0a6fd /drivers/target/iscsi/cxgbit/cxgbit_ddp.c | |
parent | b849b4567549d5a54ab34ffacfd48fca05e8b34e (diff) | |
download | op-kernel-dev-1ae01724ae92004be36a6c11c4d5a9f94e915204.zip op-kernel-dev-1ae01724ae92004be36a6c11c4d5a9f94e915204.tar.gz |
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.c | 8 |
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 5fdb57c..768cce0 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, |