[SCSI] libiscsi: fix data corruption when target has to resend data-in packets
authorMike Christie <michaelc@cs.wisc.edu>
Wed, 24 Sep 2008 16:46:09 +0000 (11:46 -0500)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Mon, 13 Oct 2008 13:28:58 +0000 (09:28 -0400)
commit1d9edf0270cb5a434d32e95279ce9493581906b3
tree1b54cdd2c8b18e78a788d7f1f3c17c7b73043c24
parentcbdc14459bd7d99d20341ec057b8f4ffab2a7fb6
[SCSI] libiscsi: fix data corruption when target has to resend data-in packets

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: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/iscsi_tcp.c
drivers/scsi/libiscsi.c