Subject: Re: nullfs mounts
To: Matthew Mondor <mmondor@gobot.ca>
From: Julio Merino <jmmv@menta.net>
List: tech-kern
Date: 01/18/2003 10:34:09
See bin/17673 (http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=17673)
I reported the same for mount_union. The answer was that you must not use the
mount_* stuff, but use the real mount program, which will do all necessary
sanity checks.
HTH
On Sat, 18 Jan 2003 00:17:49 -0500
Matthew Mondor <mmondor@gobot.ca> wrote:
> 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
>
--
Julio M. Merino Vidal <jmmv@menta.net>
The NetBSD Project - http://www.NetBSD.org/