public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* sg driver and the error handler
@ 2005-05-10 18:51 Alan Stern
  2005-05-10 22:58 ` Patrick Mansfield
  0 siblings, 1 reply; 19+ messages in thread
From: Alan Stern @ 2005-05-10 18:51 UTC (permalink / raw)
  To: James Bottomley, Doug Gilbert; +Cc: SCSI development list

I don't know who the right person is to handle this, but maybe someone can 
help...

When a command injected through the sg driver encounters any sort of
error, the usual retry mechanism and error handler are brought into play.  
Since sg sets the number of retries to 0 by default, the retry mechanism
shouldn't cause any difficulty.  But the error handler does.  IMO it
should never get involved with requests coming through sg -- sg should
provide access that is as transparent as possible so that userspace
programs will have a clean shot at managing their device.

Consider a case that just came up.  A USB CD drive causes a phase error
when it receives a certain READ BUFFER command (buggy firmware on the
drive, never mind that now).  You would expect the user program to receive
from sg a host_status value indicating DID_ERROR or something of the sort.

Instead the error handler takes charge and sends out one or two TEST UNIT 
READY commands.  The status information finally received by the user 
program is the status from the TEST UNIT READY, not from the failed READ 
BUFFER!  How's a program supposed to cope with that sort of obfuscation?

Something in the SCSI stack (scsi_io_completion ?) should check for 
requests coming in via sg and should know to complete the requests 
immediately.  No requeuing and no error handling.

Does this sound like a feasible thing to implement?

Alan Stern


^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <20050603160921.GA32212@us.ibm.com>]

end of thread, other threads:[~2005-06-03 16:37 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-10 18:51 sg driver and the error handler Alan Stern
2005-05-10 22:58 ` Patrick Mansfield
2005-05-11 11:59   ` Douglas Gilbert
2005-05-11 16:35     ` Luben Tuikov
2005-05-11 17:45       ` Patrick Mansfield
2005-05-11 17:55         ` Luben Tuikov
2005-05-11 18:02           ` Patrick Mansfield
2005-05-11 19:43       ` Alan Stern
2005-05-11 16:40   ` Luben Tuikov
2005-05-11 17:14     ` Patrick Mansfield
2005-05-16 17:42   ` [PATCH] saved and restore result for timed out commands Patrick Mansfield
2005-05-16 19:42     ` Alan Stern
2005-06-01 18:45     ` Alan Stern
2005-06-01 21:00       ` James Bottomley
2005-06-01 21:26         ` Alan Stern
2005-06-01 21:57           ` Patrick Mansfield
2005-06-03 15:21           ` James Bottomley
2005-06-03 15:35             ` Alan Stern
     [not found] <20050603160921.GA32212@us.ibm.com>
2005-06-03 16:37 ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox