Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Apr 2009 04:30:16 +0000 (UTC)
From:      Stephen McKay <mckay@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r190837 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern
Message-ID:  <200904080430.n384UGWw043589@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckay
Date: Wed Apr  8 04:30:16 2009
New Revision: 190837
URL: http://svn.freebsd.org/changeset/base/190837

Log:
  MFC r187460: Add a limit on namecache entries.
  
  Approved by: re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/vfs_cache.c

Modified: stable/7/sys/kern/vfs_cache.c
==============================================================================
--- stable/7/sys/kern/vfs_cache.c	Wed Apr  8 03:53:20 2009	(r190836)
+++ stable/7/sys/kern/vfs_cache.c	Wed Apr  8 04:30:16 2009	(r190837)
@@ -495,6 +495,12 @@ cache_enter(dvp, vp, cnp)
 	if (!doingcache)
 		return;
 
+	/*
+	 * Avoid blowout in namecache entries.
+	 */
+	if (numcache >= desiredvnodes * 2)
+		return;
+
 	if (cnp->cn_nameptr[0] == '.') {
 		if (cnp->cn_namelen == 1) {
 			return;



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