If an application builds an INQUIRY CDB containing a
command length longer than the expected transfer
length of the command, the iscsi subsystem resets the
transfer length to the size of the INQUIRY CDB. Then if
the target accually returns more than the initial expected
transfer length the data buffer isn't large enought to
contain it.
In this case a message similar to
"iSCSI: session f5bf8000 recv_data for itt 94, task
ec1eff18, cmnd eac38600, bufflen 200, Data PDU with
offset 0 len 255 overflows command buffer, dropping
session"
is returned by the initiator and the session gets dropped.
Removing the code to reset the transfer len to the size
of the INQUIRY CDB solves this problem.
This patch also fixes a build problem, when debug is
turned on.
Patch to fix dropped sessions and a build problem when debug is enabled