Re: Of removable devices

From: Manfred Spraul (manfreds@colorfullife.com)
Date: Wed Feb 16 2000 - 17:49:01 EST


Francis GALIEGUE
>
> The big problem is that mounting/unmounting is not possible if the
> mount point is currently being busy.
>
As far as I know about both Win95 and WinNT, the OS doesn't unmount the
busy volume: it mounts a second volume for the same drive letter, and
wait until all handles to the now hidden volume get closed. After the
final close, the old volume is automatically destroyed.

If you remove a volume, and access a drive letter without any volume
inserted, then the default filesystem will mount a pseudo "nothing"
volume.

Just try this with Windows 95/98 or NT:

* insert a floppy
* open a file, do not close the file handle (fh_1)
* replace the floppy with another floppy
* use the new floppy
* now read a few bytes with fh_1. The OS will pop up a dialog box
[either from user space, or as a blue screen].

> With the current VFS
> implementation, the superblock pointer in a dentry cannot be changed
> if the dentry is in use. So yes, you're right, it requires that half,
> if not more, of the VFS be rewritten :( I'll have a deeper look at all
> this to identify all possible problems.

I don't think that any major VFS changes are required: we must hide
removed disks, and add a new filesystem on top of the currently mounted
path.

The block device changes are far more difficult.
E.g. if someone write to a handle that points to the removed disk, we
must either fail these calls, or a user space daemon must request that
disk back. This means that we would need another layer between the
filesystems and the block device drivers...

--
	Manfred

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:17 EST