• Mike Christie's avatar
    [SCSI] libiscsi: fix data corruption when target has to resend data-in packets · 1d9edf02
    Mike Christie authored
    iscsi_tcp was updating the exp_statsn (exp_statsn acknowledges
    status and tells the target it is ok to let the resources for
    a iscsi pdu to be reused) before it got all the data for pdu read
    into OS buffers. Data corruption was occuring if something happens
    to a packet and the network layer requests a retransmit, and the
    initiator has told the target about the udpated exp_statsn ack,
    then the target may be sending data from a buffer it has reused
    for a new iscsi pdu. This fixes the problem by having the LLD
    (iscsi_tcp in this case) just handle the transferring of data, and
    has libiscsi handle the processing of status (libiscsi completion
    processing is done after LLD data transfers are complete).
    Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
    1d9edf02
libiscsi.c 71.1 KB