Re: PATCH; make sr.c respect use_10_for_ms

Linus Torvalds
2003-06-22T00:08:16Z

On Sat, 21 Jun 2003, Matthew Dharm wrote:
>
> I mean, this works, it's not difficult to follow, and meets all the
> operational goals.

As far as I can tell, your patch is not actually all that stable.

Imagine a flaky SCSI connection (think iscsi or whatever), where your
commands are getting lost or corrupted. The first mode-sense command goes
out, it takes a while to come back, another one goes out for some other
reason (like scsi-generic), that other one failes due to something else,
and look what happens: two bugs in one schenario:

- your code will clear "use_10_for_ms" even though the failure code
wasn't due to an unrecognized command, but due to something else
(timeout, out-of-memory, whatever)

- when the other sense command comes back, it was sent with
"use_10_for_ms" active, but by the time the result comes back it has
been cleared, and now we'll use that flag to test what the sense data
means. So now we'll get the size wrong.

That sounds flaky to me.

Linus