Revert "ISCSI fix broken send logic in iscsi_scsi_async_command"
This reverts commit 548bd22f51.
Revert for now. Will check it later today.
Causes 0130 and other tests to fail/hang when sending a solicited data-out
This commit is contained in:
@@ -19,8 +19,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
/* We need this until we have an iscsi_task to get access to the iovector_out */
|
||||
#include "scsi-lowlevel.h"
|
||||
|
||||
#if defined(WIN32)
|
||||
#include <basetsd.h>
|
||||
@@ -221,8 +219,6 @@ struct iscsi_pdu {
|
||||
|
||||
int written;
|
||||
|
||||
struct scsi_task *task; /* Reference to scsi_task to get iov with output data */
|
||||
|
||||
struct iscsi_data outdata; /* Header for PDU to send */
|
||||
uint32_t out_offset; /* Offset into data-out iovector */
|
||||
uint32_t out_len; /* Amount of data to sent */
|
||||
|
||||
@@ -115,7 +115,6 @@ iscsi_send_data_out(struct iscsi_context *iscsi, struct iscsi_pdu *cmd_pdu,
|
||||
|
||||
pdu->callback = cmd_pdu->callback;
|
||||
pdu->private_data = cmd_pdu->private_data;
|
||||
pdu->task = cmd_pdu->task;
|
||||
|
||||
if (iscsi_queue_pdu(iscsi, pdu) != 0) {
|
||||
iscsi_set_error(iscsi, "Out-of-memory: failed to queue iscsi "
|
||||
@@ -181,8 +180,6 @@ iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun,
|
||||
return -1;
|
||||
}
|
||||
|
||||
pdu->task = task;
|
||||
|
||||
pdu->scsi_cbdata.task = task;
|
||||
pdu->scsi_cbdata.callback = cb;
|
||||
pdu->scsi_cbdata.private_data = private_data;
|
||||
@@ -206,7 +203,6 @@ iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun,
|
||||
|
||||
if (len > iscsi->first_burst_length) {
|
||||
len = iscsi->first_burst_length;
|
||||
flags &= ~ISCSI_PDU_SCSI_FINAL;
|
||||
}
|
||||
|
||||
pdu->out_offset = 0;
|
||||
@@ -214,7 +210,7 @@ iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun,
|
||||
|
||||
/* update data segment length */
|
||||
scsi_set_uint32(&pdu->outdata.data[4], pdu->out_len);
|
||||
} else if (task->iovector_out.niov > 0 && iscsi->use_initial_r2t == ISCSI_INITIAL_R2T_NO) {
|
||||
} else if (iscsi->use_initial_r2t == ISCSI_INITIAL_R2T_NO) {
|
||||
/* We have more data to send, and we are allowed to send
|
||||
* unsolicited data, so dont flag this PDU as final.
|
||||
*/
|
||||
@@ -253,7 +249,7 @@ iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun,
|
||||
}
|
||||
|
||||
/* Can we send some unsolicited data ? */
|
||||
if (task->iovector_out.niov > 0 && iscsi->use_initial_r2t == ISCSI_INITIAL_R2T_NO && iscsi->use_immediate_data == ISCSI_IMMEDIATE_DATA_NO) {
|
||||
if (pdu->out_len != 0 && iscsi->use_initial_r2t == ISCSI_INITIAL_R2T_NO && iscsi->use_immediate_data == ISCSI_IMMEDIATE_DATA_NO) {
|
||||
uint32_t len = task->expxferlen - pdu->out_len;
|
||||
|
||||
if (len > iscsi->first_burst_length) {
|
||||
@@ -1586,6 +1582,6 @@ iscsi_scsi_cancel_all_tasks(struct iscsi_context *iscsi)
|
||||
unsigned char *
|
||||
iscsi_get_user_out_buffer(struct iscsi_context *iscsi _U_, struct iscsi_pdu *pdu, uint32_t pos, ssize_t *count)
|
||||
{
|
||||
return scsi_task_get_data_out_buffer(pdu->task, pos, count);
|
||||
return scsi_task_get_data_out_buffer(pdu->scsi_cbdata.task, pos, count);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user