svn commit: r222886 - stable/8/sys/fs/nfsclient

[ Available lists | Index of svn-src-all | Month of Jun 2011 | Week of 9 Jun 2011 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Rick Macklem <rmacklem@FreeBSD.org>
Date
9 Jun 2011 01:10:40
Subject
svn commit: r222886 - stable/8/sys/fs/nfsclient
Message-ID
201106090110.p591Aen4055250@svn.freebsd.org


[ Hide this part ]
Author: rmacklem
Date: Thu Jun 9 01:10:39 2011
New Revision: 222886
URL: http://svn.freebsd.org/changeset/base/222886

Log:
MFC: r222329
Add a check for MNTK_UNMOUNTF at the beginning of nfs_sync()
in the new NFS client so that a forced dismount doesn't
get stuck in the VFS_SYNC() call that happens before
VFS_UNMOUNT() in dounmount().
Additional changes are needed before forced dismounts will work.

Modified:
stable/8/sys/fs/nfsclient/nfs_clvfsops.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/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Thu Jun 9 00:34:56 2011 (r222885)
+++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Thu Jun 9 01:10:39 2011 (r222886)
@@ -1454,10 +1454,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);

Elapsed time: 0.086 seconds