enable forcible unmount
[unix-history] / usr / src / sys / nfs / nfs_vfsops.c
index 774b73c..c1c9394 100644 (file)
@@ -7,7 +7,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)nfs_vfsops.c        7.27 (Berkeley) %G%
+ *     @(#)nfs_vfsops.c        7.28 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -432,10 +432,11 @@ nfs_unmount(mp, mntflags, p)
        int flags = 0;
        int error;
 
        int flags = 0;
        int error;
 
-       if (mntflags & MNT_FORCE)
-               return (EINVAL);
-       if (mntflags & MNT_FORCE)
+       if (mntflags & MNT_FORCE) {
+               if (mp == rootfs)
+                       return (EINVAL);
                flags |= FORCECLOSE;
                flags |= FORCECLOSE;
+       }
        nmp = VFSTONFS(mp);
        /*
         * Clear out the buffer cache
        nmp = VFSTONFS(mp);
        /*
         * Clear out the buffer cache