On Wed, 14 Mar 2007, Edward Chapman wrote:

> Hi,
> 
> On vanilla kernel 2.6.20, Netac OnlyDisk Mini 512MB usb stick lets you
> write a file and copy it from the device until it is unmounted.  Upon
> mounting the device again, attempts to copy the file written on last
> mount results in SCSI I/O errors and the cp command eventually failing
> (see error log at the bottom of this message).

Those error messages aren't very informative.  It would help to have a 
usbmon log.  Instructions for usbmon are in the kernel source file 
Documentation/usb/usbmon.txt.

Post a log showing what happens when you mount the drive, copy a short 
file (no more than 1 KB), unmount it, mount it again, and try to copy the 
file back.

> The good news is adding the device to drivers/usb/storage/unusual_devs.h
> with the US_FL_IGNORE_RESIDUE flag completely cures the problem :)  I've
> attached a patch against 2.6.20 to add the device to this file.
> 
> The bad news is adding the device to unusual_devs.h and using any of the
> flags (I tried many of them) causes the device to be incorrectly
> detected as write protected. I tried using  US_FL_NO_WP_DETECT (does
> this disable write protect?)

It doesn't disable write-protect -- the only way to do that is by setting
the device's switch off.  However it does prevent the kernel from asking
the device whether it is write-protected.

>  but to no avail. I've had to hack
> sd_read_write_protect_flag() in drivers/scsi/sd.c to disable write
> protect detection in order to use the device with it added to
> unusual_devs.h.
> 
> Without adding the device to unusual_devs.h, write protect detection
> works fine.  The device does have a write protect switch by the way, and
> yes I have it set to off.
> 
> So my question is can anyone help me figure out the incorrect write
> protect detection problem?  I can test, provide whatever info needed.  I
> have over 40 of these devices so I'm desperate to iron out this last
> issue :)

Post another usbmon log showing what happens with your unusual_devs entry 
present.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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