[stgt] [PATCH 1/1] SCSI residual reporting

ronnie sahlberg ronniesahlberg at gmail.com
Mon Apr 18 09:48:47 CEST 2011


Tomo, List

Please find attached a patch against the residual calculation for iscsi.
The residual calculation used to check task->len versus the size of
the in buffer,
which probably always would be the same so residuals were probably
never reported.

Instead I think more correct is to check the in->residual counter for
the actual buffer and use it as
the residual detection.

The patch also sets the expected and residual values from the sbc_rw()
function, which should make READ*/WRITE*
now setting and reproting residuals properly.
(Well,  the write functions will not do that yet since the lack of
out->residual checking, but that is just as before)


To test this I use a special test tool which contains tests for
different types of malformed iscsi/scsi commands.
In this case sedning iSCSI commands that have EDTL values that do not
match up to the READ10 TRANSFER LENGTH.


I have also attached a small capture of this particular test that
shows how tgtd responds with this patch.
Ignore packets 20/21 for now. I dont know what these should result in
but it probably should be a check condition, not just a simple
residual.



regards
ronnie sahlberg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Implement-residual-correctly-when-creating-a-DATA-IN.patch.gz
Type: application/x-gzip
Size: 1111 bytes
Desc: not available
URL: <http://lists.wpkg.org/pipermail/stgt/attachments/20110418/f46c187e/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Implement-residual-correctly-when-creating-a-DATA-IN.patch
Type: text/x-diff
Size: 2578 bytes
Desc: not available
URL: <http://lists.wpkg.org/pipermail/stgt/attachments/20110418/f46c187e/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0105_read10_invalid.cap
Type: application/cap
Size: 5484 bytes
Desc: not available
URL: <http://lists.wpkg.org/pipermail/stgt/attachments/20110418/f46c187e/attachment-0002.bin>


More information about the stgt mailing list