svn commit: r212452 - stable/8/sys/fs/nfsserver
Rick Macklem
rmacklem at FreeBSD.org
Sat Sep 11 02:00:28 UTC 2010
Author: rmacklem
Date: Sat Sep 11 02:00:27 2010
New Revision: 212452
URL: http://svn.freebsd.org/changeset/base/212452
Log:
MFC: r211953
Add acquisition of a reference count on nfsv4root_lock in the
nfsd_recalldelegation() function, since this function is called
by nfsd threads when they are handling NFSv2 or NFSv3 RPCs, where
no reference count would have been acquired.
Modified:
stable/8/sys/fs/nfsserver/nfs_nfsdstate.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)
stable/8/sys/dev/xen/xenpci/ (props changed)
Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c
==============================================================================
--- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sat Sep 11 01:51:45 2010 (r212451)
+++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sat Sep 11 02:00:27 2010 (r212452)
@@ -4563,6 +4563,14 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO
return;
/*
+ * First, get a reference on the nfsv4rootfs_lock so that an
+ * exclusive lock cannot be acquired by another thread.
+ */
+ NFSLOCKV4ROOTMUTEX();
+ nfsv4_getref(&nfsv4rootfs_lock, NULL, NFSV4ROOTLOCKMUTEXPTR);
+ NFSUNLOCKV4ROOTMUTEX();
+
+ /*
* Now, call nfsrv_checkremove() in a loop while it returns
* NFSERR_DELAY. Return upon any other error or when timed out.
*/
@@ -4576,11 +4584,14 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO
NFS_REMOVETIMEO &&
((u_int32_t)mytime.tv_sec - starttime) <
100000)
- return;
+ break;
/* Sleep for a short period of time */
(void) nfs_catnap(PZERO, 0, "nfsremove");
}
} while (error == NFSERR_DELAY);
+ NFSLOCKV4ROOTMUTEX();
+ nfsv4_relref(&nfsv4rootfs_lock);
+ NFSUNLOCKV4ROOTMUTEX();
}
APPLESTATIC void
More information about the svn-src-stable
mailing list