svn commit: r223002 - stable/8/sys/nfsclient

Rick Macklem rmacklem at FreeBSD.org
Sun Jun 12 01:48:31 UTC 2011


Author: rmacklem
Date: Sun Jun 12 01:48:31 2011
New Revision: 223002
URL: http://svn.freebsd.org/changeset/base/223002

Log:
  MFC: r222464
  Add a check for MNTK_UNMOUNTF at the beginning of nfs_sync()
  in the old NFS client so that a forced dismount doesn't
  get stuck in the VFS_SYNC() call that happens before
  VFS_UNMOUNT() in dounmount(). Analagous to r222329 for the new NFS client.
  An additional change is needed before forced dismounts will work.

Modified:
  stable/8/sys/nfsclient/nfs_vfsops.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/nfsclient/nfs_vfsops.c
==============================================================================
--- stable/8/sys/nfsclient/nfs_vfsops.c	Sun Jun 12 00:14:57 2011	(r223001)
+++ stable/8/sys/nfsclient/nfs_vfsops.c	Sun Jun 12 01:48:31 2011	(r223002)
@@ -1406,10 +1406,20 @@ nfs_sync(struct mount *mp, int waitfor)
 
 	td = curthread;
 
+	MNT_ILOCK(mp);
+	/*
+	 * If a forced dismount is in progress, return from here so that
+	 * the umount(2) syscall doesn't get stuck in VFS_SYNC() before
+	 * calling VFS_UNMOUNT().
+	 */
+	if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) {
+		MNT_IUNLOCK(mp);
+		return (EBADF);
+	}
+
 	/*
 	 * Force stale buffer cache information to be flushed.
 	 */
-	MNT_ILOCK(mp);
 loop:
 	MNT_VNODE_FOREACH(vp, mp, mvp) {
 		VI_LOCK(vp);


More information about the svn-src-stable-8 mailing list