About this list Date view Thread view Subject view Author view Attachment view

From: Björn Steinbrink (bjoern.steinbrink_at_isp4p.net)
Date: Fri 29 Oct 2004 - 04:04:11 BST


On Fri, 29 Oct 2004 12:10:04 +1300
Sam Vilain <sam_at_vilain.net> wrote:

> Found that tricky can't-remove-the-mount-point bug.
>
> clunker:/vservers# mkdir compileit
> clunker:/vservers# grep compileit /etc/fstab
> /dev/clunker/compileit /vservers/compileit ext3 defaults 1 2
> clunker:/vservers# mount compileit/
> kclunker:/vservers# journald starting. Commit interval 5 seconds
> EXT3 FS on dm-1, internal journal
> EXT3-fs: mounted filesystem with ordered data mode.
> vserver bind start
> Mounting shadow filesystems for bind
> Starting system log daemon: syslogd.
> Starting kernel log daemon: klogd.
> Starting domain name service: named.
> clunker:/vservers# vserver bind exec grep comp /proc/mounts
> clunker:/vservers# grep comp /proc/mounts
> /dev/clunker/compileit /vservers/compileit ext3 rw 0 0
> clunker:/vservers# vserver bind exec cat /proc/mounts
> clunker:/vservers# umount compileit
> clunker:/vservers# rmdir compileit
> rmdir: `compileit': Device or resource busy
> clunker:/vservers# vserver bind stop
> Sending all processes the TERM signal...done.
> Sending all processes the KILL signal...done.
> clunker:/vservers# rmdir compileit/
> clunker:/vservers#
>
> Look! It works with tmpfs, too!
>
> clunker:/vservers# mkdir foo
> clunker:/vservers# mount -t tmpfs none foo
> clunker:/vservers# vserver bind start
> Mounting shadow filesystems for bind
> Starting system log daemon: syslogd.
> Starting kernel log daemon: klogd.
> Starting domain name service: named.
> clunker:/vservers# umount foo
> clunker:/vservers# rmdir foo
> rmdir: `foo': Device or resource busy
> clunker:/vservers# vserver bind stop
> Sending all processes the TERM signal...done.
> Sending all processes the KILL signal...done.
> clunker:/vservers# rmdir foo
> clunker:/vservers#
>
> This really shouldn't happen for mount points which are entirely
> outside the chroot of the new namespace, but I think this may be
> another point of our `chroot/pivot_root/vnamespace/mount
> --rbind/chcontext' chicken, egg, rooster, barn and farmer problem.

Yes, you mounted something on 'foo' before starting the vserver, so that
mount will also be in the vserver's namespace (but of course you can't
reach it from inside the vserver because of the chroot). Once we're able
to cleanup the namespace, this problem will be gone.

>
> For mount points which are *inside* the chroot, is this a bug or a
> feature? Is it possible to have a filesystem mounted on a path in one
> namespace, then remove the underlying directory?
>

AFAICT this is not possible. You share the actual filesystems between
the namespaces, so removing 'foo' in namespace A would also remove in
namespace B (just because you remove it from the filesystem, not from
the namespace). Now if in namespace B 'foo' is a mountpoint you would
have a hard time accessing the mounted filesystem. ;-) Therefore you
can't remove that directory.

HTH
Bjoern
_______________________________________________
Vserver mailing list
Vserver_at_list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


About this list Date view Thread view Subject view Author view Attachment view
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Fri 29 Oct 2004 - 04:04:45 BST by hypermail 2.1.3