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

Pat LaVarre
2003-11-14T02:25:14Z

> From: Matthew Dharm ...

All clear now thanks, sorry I was slow.

> > > > 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?
>
> This should already be in place.

In place by now in kernel but not yet above?

I will try 2.6.0-test9. Me, I thought when last I tried something like
this I saw dd finish without error while the dmesg filled with
complaints.

> > 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)?
>
> Presumeably, when the send a WRITE command to the device, it will refuse
> with meaningful sense data.

Works for SCSI transports that support the Dn < Ho case of the thirteen
cases, aye. Fun to see that trace showing Win XP SP1 requiring certain
Dn < Hi and Di < Hi to work.

> ...

I will report back (many hours from now) after next I can try what I
think Patrick M suggested for letting writable open of read-only sd pass
thru:

echo "$vendor:$model:0x4000" > /proc/scsi/device_info

(I'll try this with sr too, just in case it works.)

Pat LaVarre