public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Dharm <mdharm-scsi@one-eyed-alien.net>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux SCSI list <linux-scsi@vger.kernel.org>,
	Greg KH <greg@kroah.com>,
	USB Developers <linux-usb-devel@lists.sourceforge.net>
Subject: Re: PATCH; make sr.c respect use_10_for_ms
Date: Sat, 21 Jun 2003 17:30:34 -0700	[thread overview]
Message-ID: <20030621173033.J2811@one-eyed-alien.net> (raw)
In-Reply-To: <Pine.LNX.4.44.0306211716110.1980-100000@home.transmeta.com>; from torvalds@transmeta.com on Sat, Jun 21, 2003 at 05:21:53PM -0700

[-- Attachment #1: Type: text/plain, Size: 2067 bytes --]

On Sat, Jun 21, 2003 at 05:21:53PM -0700, Linus Torvalds wrote:
> 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)

True.  With this scenario and the old code, the code just makes an
assumption and goes on -- I did not aim to improve robustness, only
maintain it.  You can make the same argument about the existing code
falling back to the dumb-assumption condition under a transient error
condition.

So if this is a problem, then this entire section of code needed a rewrite
before I ever looked at it.  Until that rewrite occurs, I think my patch
adds value.

>  - 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.

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?

Matt

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

C:  Like the Furby?
DP: He gives me the creeps.  Think the SPCA will take him?
					-- Cobb and Dust Puppy
User Friendly, 1/2/1999

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

  reply	other threads:[~2003-06-22  0:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-21 23:59 PATCH; make sr.c respect use_10_for_ms Matthew Dharm
2003-06-22  0:07 ` Linus Torvalds
2003-06-22  0:12   ` Matthew Dharm
2003-06-22  0:21     ` Linus Torvalds
2003-06-22  0:30       ` Matthew Dharm [this message]
2003-06-22  0:38         ` Linus Torvalds
2003-06-22  0:46           ` Matthew Dharm
2003-06-22  0:25 ` James Bottomley
2003-06-22  0:46   ` Matthew Dharm
2003-06-22  2:54     ` James Bottomley
2003-06-22  4:24       ` Matthew Dharm
2003-06-22  5:05         ` Douglas Gilbert
2003-06-22 13:58         ` James Bottomley
2003-06-22 19:49           ` Matthew Dharm
2003-06-22 19:56             ` Matthew Dharm
2003-06-22 20:37               ` James Bottomley
2003-06-22 21:06                 ` Matthew Dharm
2003-06-23 14:33                   ` James Bottomley
2003-06-23 17:30                     ` Matthew Dharm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030621173033.J2811@one-eyed-alien.net \
    --to=mdharm-scsi@one-eyed-alien.net \
    --cc=greg@kroah.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox