Files
libiscsi/lib/iscsi-command.c
Ronnie Sahlberg 9a570e0b37 Dont clear the F-flag when we we have more data to send later as solicited data.
If we do a write that spans more than first-burst-length amount of data
and we can use immediate data.

This will lead to a sequence
I->T  SCSI_COMMAND + furst_burst_length of immediate data
T->I  R2T
I->T  DATA-OUT with the remainder of the data.
T->I  SCSI_RESPONSE

In this situation we still have to set the F-bit in the flags for the ISCSI_COMMAND.

The F-bit indicates that the PDU is the final PDU in the current sequence
and is what will trigger the target to process what it has currently received
after which the target will either respond with a SCSI-RESULT or DATA-IN if this
was the final sequence of the command,
Or in the case this was not the last sequence, then the target will send a R2T
to request the next sequence for this command.

In this scenario above we have two sequences.
the first sequence is the SCSI_COMMAND with immediate data and since it has filled the full amount of immediate data and can not send any more data until an R2T, this means this pdu ends the sequence and thus has the F-bit set.

Once we receive the R2T the second sequence starts, which also will have the F-bit set in the PDU.
2012-12-01 08:28:47 -08:00

40 KiB