Subject: Unmounting symlinks is possible, was Re: building a kernel with a read-only /usr/src
To: None <mason@primenet.com.au, current-users@NetBSD.ORG>
From: Brian C. Grayson <bgrayson@marvin.ece.utexas.edu>
List: current-users
Date: 05/14/1998 13:16:49
On Thu, May 14, 1998 at 04:45:35PM +0000, Geoff Wing wrote:
> :Heiko W.Rupp wrote:
> :> What exactly is not stable in there? You mean changing files in /usr/src
> :> and in the mount above at the same time? Or other things?
> 
> 1) don't have the mount point as a symbolic link if you intend to unmount it
>    (without rebooting your system - I think that not even a call to unmount(2)
>    did it but I'm not quite sure about that - it's been a while)

  The basic problem here is that umount does a realpath() on
the arg, which translates symlinks, but mount doesn't.
Thus, unmount(<translated name>) won't match any mounted FS's
<untranslated names> in the kernel's table.

  HOWEVER, umount now has the -R flag (thanks, der Mouse!), which
says, don't run realpath() on the arg, just take it as is. 
Using umount -R I was able to unmount a symlink union mount point
(umount then seg-faulted after the unmount, but I'm not running
current -- does it seg-fault in current also?).

  Brian
-- 
"Now we are going to take into account the temperature dependence of the Zener
  diode." -  R.P. Massey, ELEC 342
(After solving a problem using the simple model of the diode (20 minutes), and
  then reworking the same problem using a better model of the diode (another
  20 minutes), with about 3 minutes left in class.)