ISCSI fix broken send logic in iscsi_scsi_async_command [v2]
This fixes the IMMEDIATE_DATA_YES case if the paylaod did not fit into the first PDU and fixes no unsolicited data sent out iff IMMEDIATE_DATA_NO and INITIAL_R2T_NO. Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
@@ -207,6 +207,7 @@ iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun,
|
|||||||
|
|
||||||
if (len > iscsi->first_burst_length) {
|
if (len > iscsi->first_burst_length) {
|
||||||
len = iscsi->first_burst_length;
|
len = iscsi->first_burst_length;
|
||||||
|
flags &= ~ISCSI_PDU_SCSI_FINAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdu->out_offset = 0;
|
pdu->out_offset = 0;
|
||||||
@@ -253,8 +254,11 @@ iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Can we send some unsolicited data ? */
|
/* Can we send some unsolicited data ? */
|
||||||
if (pdu->out_len != 0 && iscsi->use_initial_r2t == ISCSI_INITIAL_R2T_NO && iscsi->use_immediate_data == ISCSI_IMMEDIATE_DATA_NO) {
|
if (task->xfer_dir == SCSI_XFER_WRITE
|
||||||
uint32_t len = task->expxferlen - pdu->out_len;
|
&& iscsi->use_initial_r2t == ISCSI_INITIAL_R2T_NO
|
||||||
|
&& iscsi->use_immediate_data == ISCSI_IMMEDIATE_DATA_NO) {
|
||||||
|
|
||||||
|
uint32_t len = task->expxferlen;
|
||||||
|
|
||||||
if (len > iscsi->first_burst_length) {
|
if (len > iscsi->first_burst_length) {
|
||||||
len = iscsi->first_burst_length;
|
len = iscsi->first_burst_length;
|
||||||
|
|||||||
Reference in New Issue
Block a user