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 15:53:22 +0000 (07:53 -0800)
commitf39f7550bfabac2d1290b91a0e5c6c37d276bca7
treeeface146c13b1ee24ab09916f6657161c2abb524
parentdb71f61f5db17f6d05af98faa727853dea4aaf87
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