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

Pat LaVarre
2003-11-17T21:38:56Z

> I don't have any sd removable read only media.

Eh? Does http://www.torque.net/sg/sdebug26.html
not give us all sd removable read only media?

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

Thanks for kindly finding the time to share these hints, I have now
begun the work of decrypting them.

1) `find /lib/modules -name '*.ko'` says I have no scsi.ko. If I kick
around in `make xconfig` long enough, I may find one.

2) By vendor:model I first guess we mean what bash would say as
"$vendor:$model", of 8 and x10 bytes respectively, same as in op x12
Inquiry.

> can we easily nutshell for me how well
> > write-protect works now in sd? ...
> ...
> removable ... once when found (sd_probe ... sd_revalidate_disk), and ...
> sd_open calls check_disk_change, calls sd_media_changed ...
> sd_revalidate_disk to figure out ... write_prot ...
> write_prot ... if ... set ... the open fails with EROFS.

Prompt & cogent thank you.

> AFAICT, the sd write_prot setting is never passed on up to the block layer.

Except, of course, by way of EROFS returned from sd_open.

Pat LaVarre