[sane-devel] [dev] CVS tree closed for release

abel deuring a.deuring@satzbau-gmbh.de
Sun, 04 Nov 2001 14:47:19 +0100


Henning Meier-Geinitz wrote:
> 
> Hi developers!
> 
> I'm preparing the release of SANE 1.0.6 so please do not commit any
> changes to CVS until the release is done.


Hi all,

I'm afraid that I and Eric found a quite serious problem for SCSI
command queueing under more recent Linux kernels:

If two SCSI READ commands are queued via sanei_scsi_req_enter, the
kernel reports (wrongly) for every second command a non-zero residual
count, i.e., it claims the not all requested data bytes could be read
from the device.  sanei_scsi_req_wait subtracts the residual count from
the sanei_scsi_req_enter parameter dst_size. The HP, NEC and Sharp
backends use this value to determine how many data bytes should be
processed; of course, this will lead to an error.

Eric observed this for kernel 2.4.9; I saw it for 2.4.5 and 2.4.13,
while 2.4.0 works fine.

I know that Sane 1.0.6 is due to be released, but I'm afraid that we'll
get more and more error reports as people will install newer kernels.
OTOH, the fix is really simple. It is sufficient to disable lines 2179
..2183 in sanei_scsi.c:

             if (status == SANE_STATUS_GOOD)
               {
                 if (req->dst_len)
                   *req->dst_len -= req->sgdata.sg3.hdr.resid;
               }

Any comments?

Abel