Re: [usb-storage] Re: [PATCH] fix Sony USB mass storage - pass larger receive buffer

Pat LaVarre
2003-11-14T01:54:49Z

> > From: Patrick Mansfield ...
> > For removable media, we try once when found
> > (sd_probe calls sd_revalidate_disk), and
> > generally on each open of the device as follows:

Prompt & incisive, thank you.

> From: Matthew Dharm ...
> ... I think we're basically at a point where
> the only problematic command is MODE_SENSE and
> MODE_SENSE_10, so I say blacklisting them from
> USB devices should be fine.

Lost me sorry help?

If we eat those commands, how then can write-protect work in Linux for
that rare case of an actually compliant device with a write-protectab;e
disk (like the device firmware I remember shipping myself 1994..2003)?

> > If we check after the open for a write failure
> > to read only media, we cannot keep the same
> > open semantics (return EROFS on open).

Without mode sense, we will see the open for write pass thru, and we
will have to teach the fs (ext3, fat, fat32, udf, ...) to recover
gracefully from a late write error, yes?

> > From: Patrick Mansfield ...
> > I don't have any sd removable read only
> > media.

Want an Iomega Zip drive and disk shipped to you?

(I can't arrange that easily, but if I try it might happen someday,
especially if you're precisely the next person who asks me and not the
person after that.)

(You have no Iomega Zip disk already, yes? I ask just because you can't
see the write-protect tab on a Zip disk unless you disassemble the disk
and use an electron microscope, so you might not know how to flip it.)

> > If you want to test with your read only
> > media, just use the dev flags:
> > echo "vendor:model:0x4000" > /proc/scsi/device_info
> > Then add your device, see if it comes back
> > as writable, and try to mount or write it,
> > and compare without the above (you can't
> > remove device_info entry without rebooting
> > or rmmod-ing scsi).

Will do, again I thank you for explaining.

My first guess is that in bash syntax for me we mean to take $vendor and
$model from op x12 Inquiry data, vendor = bytes[x8:F], model =
bytes[x10:1F], so for me:

vendor = "IOMEGA "
model = "ZIP 250 "
echo "$vendor:$model:0x4000" > /proc/scsi/device_info

Results you describe for allowing open to write of unwritable disk sound
to me like results I've seen in cdrom/ sr/ ide-cd land. I will try sd
and report back.

Pat LaVarre