Re: [2.6.9-rc4] USB && mass-storage && disconnect broken semantics
From: bert hubert
Date: Tue Oct 12 2004 - 05:47:55 EST
On Tue, Oct 12, 2004 at 12:24:44PM +0200, Oliver Neukum wrote:
> Devices break. You have to cope with devices going away suddenly.
> You are not required to ensure data integrity in all cases, but the system
> must not suffer. To allow that you must be able to get rid of the mounts
> even if users do not cooperate.
Well, in retrospect, the kernel appears to offer the following semantics,
perhaps unintentionally:
When a device goes away for any reason, but there are mounts that
refer to it, the device nominally stays around and an umount will
always succeed, removing the vestiges of the device with it.
This would in fact allow something in userspace listening to hotplug events
to umount on a disconnect event from USB. Except that I'm not sure if the
semantics above are guaranteed - they may just be an accident.
Things get more complicated if we have logical volumes or raid partitions
which ultimately depend on a device that is removed. In this case, userspace
should be aware of all dependencies in order to know which mountpoints to
umount. This might even include loopback mounts.
The kernel knows the dependencies implicitly and might be in a better
position to know what is invalidated by a disconnect, and which devices
disappear because of dependencies on it.
I'm hoping either Greg or Al will chime in - it appears as if part of the
infrastructure is there, but not quite developed.
Thanks.
--
http://www.PowerDNS.com Open source, database driven DNS Software
http://lartc.org Linux Advanced Routing & Traffic Control HOWTO
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/