On Tue, 2003-09-23 at 10:23, Alan Stern wrote: > Is there any way to notify the system that you are about to unplug a > drive? It seems to me that the best approach is to flush the cache on an > unmount. People naturally assume that it's safe to unplug a device once > it has been unmounted, and they also realize that it's unsafe to unplug a > device containing a mounted filesystem. > > That doesn't address the problem of raw device access, but perhaps > whatever ioctl is used by blockdev --flushbufs can also flush the cache.
Well, a synchronize can be really expensive (minutes to flush on a large array), you only really want to do it if absolutely necessary, so tying it to something separate from normal OS operation seems like the best thing to do. > Is there any harm in sending a SYNCHRONIZE command to a device that > doesn't need it (write-through cache)? Maybe doing that is less dangerous > than trying to read mode-sense page 8 on these buggy USB devices. > (Although I'm not aware of anyone who has tried the experiment.) Devices that don't support mode page 8 invariably seem to react badly to the SYNCHRONIZE command (I have a few of these SCSI devices)...Although, usually they just send an ILLEGAL COMMAND sense. I wouldn't like to try the same thing with a USB device... James ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel