On Thu, 8 Dec 2005, Dmitry Antipov wrote:

> An idea beyond this patch is to disallow r/w mounts for storage devices 
> emulated with
> g_file_storage with 'ro=1'. This is done by setting device type to TYPE_ROM 
> instead
> of TYPE_DISK.

This patch is a very bad idea.  If you use it, the gadget will appear to 
be a CD-ROM drive instead of a disk drive.  The host will try to ask it to 
play music instead of reading/writing data!

If you want to prevent a Linux host from allowing read-write mounts of a
write-protected gadget, the correct way is to add the "removable=y"  
module parameter.  For some reason (don't ask me why -- I don't know) the
SCSI core doesn't check a disk device's write-protect status unless the
device is marked as removable.

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to