From 3ae7cec51d6b7f61bd96adf34697b53b07cb6869 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Fri, 30 Nov 2012 06:49:53 -0800 Subject: [PATCH] Revert "ISCSI fix broken send logic in iscsi_scsi_async_command" This reverts commit 548bd22f51bc8dc9f7111dd0197f8c3dcb24b88a. Revert for now. Will check it later today. Causes 0130 and other tests to fail/hang when sending a solicited data-out --- include/iscsi-private.h | 4 ---- lib/iscsi-command.c | 10 +++------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/include/iscsi-private.h b/include/iscsi-private.h index d48fa28..0dcc5f7 100644 --- a/include/iscsi-private.h +++ b/include/iscsi-private.h @@ -19,8 +19,6 @@ #include #include -/* We need this until we have an iscsi_task to get access to the iovector_out */ -#include "scsi-lowlevel.h" #if defined(WIN32) #include @@ -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 */ diff --git a/lib/iscsi-command.c b/lib/iscsi-command.c index f756149..ad8c9a5 100644 --- a/lib/iscsi-command.c +++ b/lib/iscsi-command.c @@ -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); }