Subject: nullfs mounts
To: None <tech-kern@netbsd.org>
From: Matthew Mondor <mmondor@gobot.ca>
List: tech-kern
Date: 01/18/2003 00:17:49
Hi all,

I wonder if anyone else have stumbled into this (and if -current perhaps
also has this problem, or other releases. I run 1.6_STABLE):

Mounting a nullfs filesystem with an non-absolute mountpoint results in
a parmanent mount entry which umount cannot handle anymore. To demonstrate
this:

A /tmp directory exists in the / filesystem and it is mounted virtually
using nullfs to an existing tmp directory under servroot.

# cd /servroot
# mount_null -o noexec /tmp tmp
# df
/tmp            991262   185330    756368    19%    tmp
# umount tmp
umount: /servroot/tmp: not currently mounted
# umount ./tmp
umount: /servroot/tmp: not currently mounted
# umount /servroot/tmp 
umount: /servroot/tmp: not currently mounted
# umount /tmp 
umount: /tmp: not currently mounted

Additionally, if a / is appended to a mountpoint path, a similar problem
exists:

# mount_null -o noexec /tmp/ /servroot/tmp/
# df
/tmp            991262   185330    756368    19%    /servroot/tmp/
# umount /servroot/tmp/
umount: /servroot/tmp: not currently mounted

So the problem seems to have to do with the sanity checking of the supplied
mountpoint, which mount(2) performs, or the vfs nullfs call for mount(2)...
Unfortunately I could not verify yet if this consists of a more general
problem with other filesystems as well.

Because obviously both first and second tests should have translated the
mountpoint to /servroot/tmp ... There is no problem when using the perfect
path i.e.

# mount_null -o noexec /tmp /servroot/tmp

[ now off to reboot to get rid of my problematic mountpoints :) ]

Matt