write protect freezes my usb stick
i have a little problem with my usb memory stick
it is an 'easy disk usb2.0' with 128mb on it,
when i mount the stick (write enabled or protected)
it mounts it read-write (btw i do use the 'sync' potion)
when i set the stick to write-protected and write to it the usb stick crashes (no ctrl-z or ctrl-c, no cancel buttons in gnome etc) and i have to rmmod usb-storage to get it to work again.
it otherwise works 100% fine on write enabled.
a) is it a kernel bug (kernel 2.6.7-ck4-grsec)
b) is it a bug when tryin to recongnise the scsi 'writeprotect' command
c) or is it buggy firmware on the stick!
Are you unmounting the stick between it being write-enabled and setting it to write-protected?
As memory serves, it checks to see if it's write-protecte d when it's originally mounted.
Also, take a look in /proc/partitions and see if it's marked as “ro” (read-only); if not, I'm not surprised that writing to it causes the module to lock up.
i write files synchronously to the stick (no pending writes) but if the stick is writeprotected when i start to write it or umount hangs.
I could be wrong, but it sounds to me like the stick is not being unmounted when it is unplugged. Thus, when you plug it back in, nothing can check if it's now read-only or not.
Does it work if you unmount the device with umount, then unplug it, then switch it to read-only, then plug it back in, all in that order?
|All times are GMT -5. The time now is 10:46 AM.|