Re: devfs vs udev, thoughts from a devfs user

Kevin P. Fleming
2004-02-11T01:41:27Z

Greg KH wrote:

> Doesn't work for what we want here:
>
> $ mkdir /tmp/a /tmp/b
> $ mount -t ramfs none /tmp/a
> $ touch /tmp/a/foo
> $ mount --move /tmp/a /tmp/b
> $ ls /tmp/b
> foo
> $ umount /tmp/a
> $ ls /tmp/b
> $

That seems very odd, the "umount /tmp/a" should have failed, given than
nothing is mounted there any longer.

Also, what will happen if something on the filesystem on /tmp/a is open
(say, /dev/console)? I was thinking that this process might work better:

$ mkdir /tmp/a /tmp/b
$ mount -t ramfs test /tmp/a
$ touch /tmp/a/foo
$ mount --bind /tmp/a /tmp/b
$ ls /tmp/b
foo
$ umount /tmp/a
$ ls /tmp/b
foo

And it does. In fact, it seems to work fine as long as no files are open
on the ramfs when the umount is executed (otherwise -EBUSY).