Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Feb 2001 12:54:29 -0800 (PST)
From:      Ian Dowse <iedowse@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/kern init_main.c vfs_syscalls.c
Message-ID:  <200102282054.f1SKsTJ18999@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
iedowse     2001/02/28 12:54:29 PST

  Modified files:
    sys/kern             init_main.c vfs_syscalls.c 
  Log:
  The kernel did not hold a vnode reference associated with the
  `rootvnode' pointer, but vfs_syscalls.c's checkdirs() assumed that
  it did. This bug reliably caused a panic at reboot time if any
  filesystem had been mounted directly over /.
  
  The checkdirs() function is called at mount time to find any process
  fd_cdir or fd_rdir pointers referencing the covered mountpoint
  vnode. It transfers these to point at the root of the new filesystem.
  However, this process was not reversed at unmount time, so processes
  with a cwd/root at a mount point would unexpectedly lose their
  cwd/root following a mount-unmount cycle at that mountpoint.
  
  This change should fix both of the above issues. Start_init() now
  holds an extra vnode reference corresponding to `rootvnode', and
  dounmount() releases this reference when the root filesystem is
  unmounted just before reboot. Dounmount() now undoes the actions
  taken by checkdirs() at mount time; any process cdir/rdir pointers
  that reference the root vnode of the unmounted filesystem are
  transferred to the now-uncovered vnode.
  
  Reviewed by:	bde, phk
  
  Revision  Changes    Path
  1.163     +2 -1      src/sys/kern/init_main.c
  1.179     +33 -12    src/sys/kern/vfs_syscalls.c


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102282054.f1SKsTJ18999>