[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

generic SCSI bug (was Re: Help with cdda2wav beta 05)



>Heiko and I enhanced the /dev/sg code to allow to see more error codes
>and to set all possible scsi command lengths. When ready, it turned
>out, that the lower level SCSI code overwrites the SCSI status code
>with the status code of the REQUEST SENSE command. This results that
>although we now have a better /dev /sg driver, we cannot see better
>error codes ;-)

You're right and wrong; note that the result of the original command
is overwritten but the sense information is there. The fact that the
driver did a sense due to error is made apparent (the 'exit' code from
scsi.c is the MSB [byte 3] of the return value in the sg header.
Whatever the result, it will be nonzero if there was any sense done).

The SCSI generic code *never checks this value*.  It only checks byte
2 (via host_byte which equals (result & 0xff0000)>>16) meaning that
any error which forced a sense in the kernel (nearly all of them) will
be missed completely.

Thus, the scsi generic driver, as it stands, will never return an
error code if the original command results in CHECK_CONDITION or
COMMAND_TERMINATED (which is pretty much every error I can think of
:-)

Wanna fix it, or should I? :-) I'm just an application developer.  I
hate hacking the kernel.

Monty


--  
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: