Re: PATCH; make sr.c respect use_10_for_ms

Linus Torvalds
2003-06-22T00:25:11Z

On Sat, 21 Jun 2003, Matthew Dharm wrote:
>
> I don't see how a sense command sent from the scsi-generic interface will
> affect (or be affected by) use_10_for_ms -- if scsi-generic issues the
> command, this code path won't try to interpret the data at all. Perhaps
> I'm confused?

Yeah, it only works if the first command was sent through sr.c, and the
second command also clears the use_10_for_ms bit (ie it has to be sent
through the sr.c or sd.c codepaths).

The basic idea stands, though: your code depends on global device state
not to change between the creation of the command and the parsing of it.
Which just isn't a good thing to do.

sd.c gets all of these things right (including re-transmission etc),
simply because of how it does things. Which is why I prefer the sd.c
approach over the simplistic patch. sd.c just looks a lot more robust.

(Maybe that one has bugs too, but they aren't immediately obvious).

Linus