Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Feb 2011 20:46:52 +0000 (UTC)
From:      Zack Kirsch <zack@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r218714 - stable/8/sys/fs/nfsserver
Message-ID:  <201102152046.p1FKkqAR043810@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zack
Date: Tue Feb 15 20:46:51 2011
New Revision: 218714
URL: http://svn.freebsd.org/changeset/base/218714

Log:
  MFC: 217335
  Clean up the experimental NFS server replay cache when the module is unloaded.

Modified:
  stable/8/sys/fs/nfsserver/nfs_nfsdcache.c
  stable/8/sys/fs/nfsserver/nfs_nfsdport.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/nfsserver/nfs_nfsdcache.c
==============================================================================
--- stable/8/sys/fs/nfsserver/nfs_nfsdcache.c	Tue Feb 15 20:18:52 2011	(r218713)
+++ stable/8/sys/fs/nfsserver/nfs_nfsdcache.c	Tue Feb 15 20:46:51 2011	(r218714)
@@ -727,9 +727,8 @@ nfsrc_freecache(struct nfsrvcache *rp)
 	newnfsstats.srvcache_size--;
 }
 
-#ifdef notdef
 /*
- * Clean out the cache. Called when the last nfsd terminates.
+ * Clean out the cache. Called when nfsserver module is unloaded.
  */
 APPLESTATIC void
 nfsrvd_cleancache(void)
@@ -752,7 +751,6 @@ nfsrvd_cleancache(void)
 	nfsrc_tcpsavedreplies = 0;
 	NFSUNLOCKCACHE();
 }
-#endif	/* notdef */
 
 /*
  * The basic rule is to get rid of entries that are expired.

Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- stable/8/sys/fs/nfsserver/nfs_nfsdport.c	Tue Feb 15 20:18:52 2011	(r218713)
+++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c	Tue Feb 15 20:46:51 2011	(r218714)
@@ -3117,6 +3117,10 @@ nfsd_modevent(module_t mod, int type, vo
 #endif
 		nfsd_call_servertimer = NULL;
 		nfsd_call_nfsd = NULL;
+
+		/* Clean the NFS server reply cache */
+		nfsrvd_cleancache();
+
 		/* and get rid of the locks */
 		mtx_destroy(&nfs_cache_mutex);
 		mtx_destroy(&nfs_v4root_mutex);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102152046.p1FKkqAR043810>