Re: cold-plugged usb flash drive not handled correctly in embedded system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 20, 2010 at 04:42:36PM +0200, Wolfgang Wegner wrote:
> ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="/bin/umount -l /mnt/usbdisk"

Hmm.  You are aware that this won't save you, right?  :-)

If someone writes a file into /mnt/usbdisk/... somewhere, and then
unplugs the USB device, this umount call will *not* flush the write out
to disk, and the file will most likely be either lost, or corrupt.

The remove event gets handed to udev *after* the device is already gone.
(And for that matter, the USB hub doesn't provide an event to the host
system until the device is already gone.  Once it's gone, you can't
delay its removal, or start any USB transactions, or anything like that:
there's no way to cleanly unmount the FS, or flush out writes, unless
the user tells you beforehand that they're going to be removing the
device.)
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux