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:17:31 +0000 (08:17 -0800)
commit7ba31c89c30fa2061bb449c97e1576a8f54fe02a
tree710160c9b60135743c2225d3cb704bf1e9ec8c09
parentc44f4961fe1ee30e4d456effa98494de403d24b0
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