[sane-devel] [fujitsu] scsi-buf-size patch

Paul Walmsley paul@booyaka.com
Tue, 6 Jul 2004 11:43:10 -0600 (MDT)


On Tue, 6 Jul 2004, abel deuring wrote:

Hi Abel,

Thanks for the good suggestions - I will implement them and send a new
patch.

One quick comment:

> (2) If sanei_scsi_open_extended does not return the required buffer 
> size, the backend should simply return an error by default. If some 
> environment variable or some option in the configuration file is set, 
> the backend may alternatively print a warning, via a DBG message. 
> Additionally, the function do_scsi_cmd should also check, if the call of 
> sanei_scsi_cmd failed with a SANE_STATUS_NO_MEM error, and if it failed 
> it should print a warning, that the failure may be caused by a too large 
> buffer size.

Just for the record, the second portion of the patch that I sent does
check to see whether the SG driver did not accept the larger buffer size,
and does at least emit a warning and reset the buffer size.  The patch
just moves that test from the configuration file parsing section, where it
was useless, to after the backend tries to set the SG buffer to the
requested size.  Anyway, I agree that it is better for the backend to stop
and emit an error message.


- Paul