DATA-OUT set pdu->cmdsn appropriately

set the cmdsn in the pdu struct so we can compare with
maxcmdsn when sending to socket even if data-out pdus
do not carry a cmdsn on the wire.

if we would not set pdu->cmdsn comparsion with
iscsi->maxcmdsn would cause a deadlock after
maxcmdsn increases to 2^31.

Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
Peter Lieven
2012-11-30 18:18:17 +01:00
parent 3ae7cec51d
commit 30df192634

View File

@@ -81,7 +81,11 @@ iscsi_send_data_out(struct iscsi_context *iscsi, struct iscsi_pdu *cmd_pdu,
return -1;
}
pdu->scsi_cbdata.task = cmd_pdu->scsi_cbdata.task;
pdu->scsi_cbdata.task = cmd_pdu->scsi_cbdata.task;
/* set the cmdsn in the pdu struct so we can compare with
* maxcmdsn when sending to socket even if data-out pdus
* do not carry a cmdsn on the wire */
pdu->cmdsn = cmd_pdu->cmdsn;
if (tot_len == len) {
flags = ISCSI_PDU_SCSI_FINAL;