summaryrefslogtreecommitdiff
path: root/drivers/scsi/qla4xxx/ql4_os.c
diff options
context:
space:
mode:
authorManish Rangankar <manish.rangankar@qlogic.com>2011-10-07 16:55:50 -0700
committerJames Bottomley <JBottomley@Parallels.com>2011-10-16 11:11:22 -0500
commit69ca216e9bbbe2baf7f441ab57c5d791f439f775 (patch)
treea6bda8a56d9f5beeb5a382b9f2b878092ad19f6b /drivers/scsi/qla4xxx/ql4_os.c
parentf922da79fd602dddb169f89471e3266cc692750a (diff)
downloadlinux-69ca216e9bbbe2baf7f441ab57c5d791f439f775.tar.gz
[SCSI] qla4xxx: Fixed target discovery failed issue.
When sendtargets response is greater then max receive data segment length, the passthrough IOCB failed with data overrun status. Solution is to allocate space for iSCSI header in the IOCB response buffer. JIRA Key: UPSISCSI-147 Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_os.c')
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 8ed3e2fc1584..fca3d2b96651 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -1272,7 +1272,7 @@ static int qla4xxx_alloc_pdu(struct iscsi_task *task, uint8_t opcode)
DEBUG2(ql4_printk(KERN_INFO, ha, "%s: MaxRecvLen %u, iscsi hrd %d\n",
__func__, task->conn->max_recv_dlength, hdr_len));
- task_data->resp_len = task->conn->max_recv_dlength;
+ task_data->resp_len = task->conn->max_recv_dlength + hdr_len;
task_data->resp_buffer = dma_alloc_coherent(&ha->pdev->dev,
task_data->resp_len,
&task_data->resp_dma,
@@ -1280,8 +1280,9 @@ static int qla4xxx_alloc_pdu(struct iscsi_task *task, uint8_t opcode)
if (!task_data->resp_buffer)
goto exit_alloc_pdu;
+ task_data->req_len = task->data_count + hdr_len;
task_data->req_buffer = dma_alloc_coherent(&ha->pdev->dev,
- task->data_count + hdr_len,
+ task_data->req_len,
&task_data->req_dma,
GFP_ATOMIC);
if (!task_data->req_buffer)
@@ -1299,7 +1300,7 @@ exit_alloc_pdu:
task_data->resp_buffer, task_data->resp_dma);
if (task_data->req_buffer)
- dma_free_coherent(&ha->pdev->dev, task->data_count + hdr_len,
+ dma_free_coherent(&ha->pdev->dev, task_data->req_len,
task_data->req_buffer, task_data->req_dma);
return -ENOMEM;
}
@@ -1328,7 +1329,7 @@ static void qla4xxx_task_cleanup(struct iscsi_task *task)
dma_free_coherent(&ha->pdev->dev, task_data->resp_len,
task_data->resp_buffer, task_data->resp_dma);
- dma_free_coherent(&ha->pdev->dev, task->data_count + hdr_len,
+ dma_free_coherent(&ha->pdev->dev, task_data->req_len,
task_data->req_buffer, task_data->req_dma);
return;
}