Author: mckusick
Date: Tue Oct 11 18:46:41 2011
New Revision: 226265
URL: http://svn.freebsd.org/changeset/base/226265

Log:
  When unmounting a filesystem always wait for the vfs_busy lock to clear
  so that if no vnodes in the filesystem are actively in use the unmount
  will succeed rather than failing with EBUSY.
  
  Reported by: Garrett Cooper
  Reviewed by: Attilio Rao and Kostik Belousov
  Tested by:   Garrett Cooper
  PR:          kern/161016
  MFC after:   3 weeks

Modified:
  head/sys/kern/vfs_mount.c

Modified: head/sys/kern/vfs_mount.c
==============================================================================
--- head/sys/kern/vfs_mount.c   Tue Oct 11 18:26:31 2011        (r226264)
+++ head/sys/kern/vfs_mount.c   Tue Oct 11 18:46:41 2011        (r226265)
@@ -1227,18 +1227,6 @@ dounmount(mp, flags, td)
                mp->mnt_kern_flag |= MNTK_UNMOUNTF;
        error = 0;
        if (mp->mnt_lockref) {
-               if ((flags & MNT_FORCE) == 0) {
-                       mp->mnt_kern_flag &= ~(MNTK_UNMOUNT | MNTK_NOINSMNTQ |
-                           MNTK_UNMOUNTF);
-                       if (mp->mnt_kern_flag & MNTK_MWAIT) {
-                               mp->mnt_kern_flag &= ~MNTK_MWAIT;
-                               wakeup(mp);
-                       }
-                       MNT_IUNLOCK(mp);
-                       if (coveredvp)
-                               VOP_UNLOCK(coveredvp, 0);
-                       return (EBUSY);
-               }
                mp->mnt_kern_flag |= MNTK_DRAINING;
                error = msleep(&mp->mnt_lockref, MNT_MTX(mp), PVFS,
                    "mount drain", 0);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to