kernel: mfs -- Fix unmount panic for MFS filesystems.
authorVenkatesh Srinivas <me@endeavour.zapto.org>
Thu, 16 Feb 2012 15:53:22 +0000 (07:53 -0800)
committerVenkatesh Srinivas <me@endeavour.zapto.org>
Thu, 16 Feb 2012 16:10:15 +0000 (08:10 -0800)
commit0a5fa2b36cd3a10f75060ac42f431307aef7cea4
treeee074e74fdde2bdd61998d1b0bbcd0b9fe5c6fb5
parentc3353c13ea2c88a125ca494e77c88e8510a7b57f
kernel: mfs -- Fix unmount panic for MFS filesystems.

mfs_start() is active for the life of an MFS mount, handling copyin/out
requests. It is directed to exit when an MFS filesystem is unmounted.
The VFS accounting code and VFS MPLOCK code assumed that the mountpoint
structure was stable on return of mfs_start, which was not the case.

To work around that, don't call acinit if the vfs_start vfsop returns
EMOUNTEXIT, a kernel-specific pseudo-errno. Also allow marking vfs_start
MPSAFE and mark mfs vfs_start MPSAFE, to avoid accessing a per-mount
token field. A future commit will rework MFS's locking so that critical
sections are not used to protect the MFS bioq.

This is a hack for MFS; future work should either rework the filesystem
or replace it outright with tmpfs.

Closes: Bug 2276
sys/kern/vfs_vfsops.c
sys/sys/errno.h
sys/sys/mount.h
sys/vfs/mfs/mfs_vfsops.c