public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@suse.de>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: ltuikov@yahoo.com,
	Matthew Dharm <mdharm-kernel@one-eyed-alien.net>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-usb@vger.kernel.org, Greg KH <greg@kroah.com>
Subject: Re: [PATCH repost 3] [SCSI] Retrieve the Caching mode page
Date: Wed, 24 Nov 2010 14:58:51 +0000	[thread overview]
Message-ID: <1290610731.7617.32.camel@mulgrave.site> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1011240945260.1513-100000@iolanthe.rowland.org>

On Wed, 2010-11-24 at 09:49 -0500, Alan Stern wrote:
> On Wed, 24 Nov 2010, James Bottomley wrote:
> 
> > On Wed, 2010-11-24 at 01:02 -0800, Luben Tuikov wrote:
> > > I doubt this as very unlikely. Has anyone actually seen a device that
> > > sends mode parameter data with faux Caching mode page or corrupted
> > > data that is in fact interpreted as a Caching mode page? Is such a
> > > device fully operational sans the faux Caching mode page, or does it
> > > just not work? Is it common to have devices having a faux Caching mode
> > > page or corrupted mode parameter data resulting in a Caching mode page
> > > with random data?
> > > 
> > > Undoubtedly, as the usb-storage maintainer, you must have variety of
> > > devices, some broken some not. Could you apply this patch to your tree
> > > and test some of the devices you have? My tests indicate a stable
> > > behavior.
> > 
> > The basic problem isn't devices lying ... the worst we'll do is current
> > behaviour (not SYNC when we should).  The problem is devices that get
> > confused (or worse simply crash the firmware).  The best way to avoid
> > the crashing firmware problem ... if we can assume that modern USB
> > devices are better is to key off the SCSI version.  Unfortunately, in
> > spite of several attempts, we've never managed to stop usbstorage lying
> > about this:
> > 
> > 		/* Some devices report a SCSI revision level above 2 but are
> > 		 * unable to handle the REPORT LUNS command (for which
> > 		 * support is mandatory at level 3).  Since we already have
> > 		 * a Get-Max-LUN request, we won't lose much by setting the
> > 		 * revision level down to 2.  The only devices that would be
> > 		 * affected are those with sparse LUNs. */
> > 		if (sdev->scsi_level > SCSI_2)
> > 			sdev->sdev_target->scsi_level =
> > 					sdev->scsi_level = SCSI_2;
> > 
> > Untangling all of this would be rather complex, I fear.
> 
> Quite likely.
> 
> > The final question is is it worth it?  Since USB devices are supposed to
> > be hot unpluggable, surely a USB device with a write back cache would be
> > a disaster: no-one will SYNC the cache on a surprise unplug anyway ...
> > therefore there shouldn't really be any of them surviving in the wild
> > (famous last words, I suppose).
> 
> Well, hot unpluggable doesn't mean it's okay to unplug the device at 
> any time.  For example, under Windows you're not supposed to unplug a 
> USB drive without first going through the "Safely remove hardware" 
> applet.  And of course, you can easily guess what command that applet 
> sends to the device...
> 
> On the whole, I'm with Luben on this.  The likelihood of introducing
> bad behavior because of devices sending incorrect cache-page
> information seems very small.

Yes, just assure me that sending the mode page request won't kill
anything and I'm fine with applying it.  As I said, as long as we get a
reply, whatever it is it can't make use behave any worse than we do now.

James

  reply	other threads:[~2010-11-24 14:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22 16:56 [PATCH repost 3] [SCSI] Retrieve the Caching mode page Luben Tuikov
2010-11-22 17:07 ` Linus Torvalds
2010-11-22 19:02   ` Douglas Gilbert
     [not found]     ` <4CEABE2E.4010609-qazKcTl6WRFWk0Htik3J/w@public.gmane.org>
2010-11-23  4:59       ` Matthew Dharm
     [not found]         ` <20101123045900.GK20296-JGfshJpz5UybPZpvUQj5UqxOck334EZe@public.gmane.org>
2010-11-23 18:40           ` Douglas Gilbert
2010-11-22 20:02   ` Luben Tuikov
2010-11-23  5:00     ` Matthew Dharm
2010-11-23  9:25       ` Luben Tuikov
     [not found]         ` <589506.10541.qm-R7kMla0nNtOvuULXzWHTWIglqE1Y4D90QQ4Iyu8u01E@public.gmane.org>
2010-11-23 14:30           ` Matthew Dharm
2010-11-24  9:02             ` Luben Tuikov
2010-11-24 10:10               ` James Bottomley
2010-11-24 14:48                 ` Christoph Hellwig
     [not found]                 ` <1290593429.14652.33.camel-0iu6Cu4xQGLYCGPCin2YbQ@public.gmane.org>
2010-11-24 14:49                   ` Alan Stern
2010-11-24 14:58                     ` James Bottomley [this message]
2010-11-24 16:55                 ` Luben Tuikov
  -- strict thread matches above, loose matches on Subject: below --
2010-11-23  8:43 Luben Tuikov
2010-12-05 20:53 Luben Tuikov
2010-12-08  0:02 Luben Tuikov
2010-12-08  0:12 ` Greg KH
     [not found]   ` <20101208001202.GA26530-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2010-12-08  5:05     ` James Bottomley
2010-12-08  8:01       ` Luben Tuikov
2010-12-08 15:16       ` Alan Stern
2010-12-08 15:43         ` James Bottomley
     [not found]           ` <1291823012.24312.52.camel-0iu6Cu4xQGLYCGPCin2YbQ@public.gmane.org>
2010-12-08 15:57             ` Alan Stern
2010-12-08 16:00               ` Matthew Wilcox

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=1290610731.7617.32.camel@mulgrave.site \
    --to=james.bottomley@suse.de \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ltuikov@yahoo.com \
    --cc=mdharm-kernel@one-eyed-alien.net \
    --cc=stern@rowland.harvard.edu \
    --cc=torvalds@linux-foundation.org \
    /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