From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 7 12:44:03 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7643A1065675; Wed, 7 Jan 2009 12:44:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62DE68FC16; Wed, 7 Jan 2009 12:44:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n07Ci3iH086091; Wed, 7 Jan 2009 12:44:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n07Ci3RI086090; Wed, 7 Jan 2009 12:44:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901071244.n07Ci3RI086090@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 7 Jan 2009 12:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186860 - in stable/7/sys: . contrib/pf dev/cxgb kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jan 2009 12:44:04 -0000 Author: kib Date: Wed Jan 7 12:44:03 2009 New Revision: 186860 URL: http://svn.freebsd.org/changeset/base/186860 Log: MFC r186600: In r185557, the check for existing negative entry for the given name did not compared nc_dvp with supplied parent directory vnode pointer. Add the check and note that now branches for vp != NULL and vp == NULL are the same, thus can be merged. Tested by: kensmith Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (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 Jan 7 12:38:31 2009 (r186859) +++ stable/7/sys/kern/vfs_cache.c Wed Jan 7 12:44:03 2009 (r186860) @@ -511,28 +511,18 @@ cache_enter(dvp, vp, cnp) CACHE_LOCK(); /* - * See if this vnode is already in the cache with this name. - * This can happen with concurrent lookups of the same path - * name. + * See if this vnode or negative entry is already in the cache + * with this name. This can happen with concurrent lookups of + * the same path name. */ - if (vp) { - TAILQ_FOREACH(n2, &vp->v_cache_dst, nc_dst) { - if (n2->nc_dvp == dvp && - n2->nc_nlen == cnp->cn_namelen && - !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) { - CACHE_UNLOCK(); - cache_free(ncp); - return; - } - } - } else { - TAILQ_FOREACH(n2, &ncneg, nc_dst) { - if (n2->nc_nlen == cnp->cn_namelen && - !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) { - CACHE_UNLOCK(); - cache_free(ncp); - return; - } + ncpp = NCHHASH(hash); + LIST_FOREACH(n2, ncpp, nc_hash) { + if (n2->nc_dvp == dvp && + n2->nc_nlen == cnp->cn_namelen && + !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) { + CACHE_UNLOCK(); + cache_free(ncp); + return; } } @@ -550,7 +540,6 @@ cache_enter(dvp, vp, cnp) * Insert the new namecache entry into the appropriate chain * within the cache entries table. */ - ncpp = NCHHASH(hash); LIST_INSERT_HEAD(ncpp, ncp, nc_hash); if (LIST_EMPTY(&dvp->v_cache_src)) { hold = 1;