Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Nov 2017 08:40:04 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325268 - head/sys/kern
Message-ID:  <201711010840.vA18e4Ab001479@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Wed Nov  1 08:40:04 2017
New Revision: 325268
URL: https://svnweb.freebsd.org/changeset/base/325268

Log:
  namecache: fix .. check broken after r324378
  
  wtf by:	mjg
  Diagnosed by:	avg

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Wed Nov  1 06:46:58 2017	(r325267)
+++ head/sys/kern/vfs_cache.c	Wed Nov  1 08:40:04 2017	(r325268)
@@ -1126,7 +1126,8 @@ cache_lookup_nomakeentry(struct vnode *dvp, struct vno
 	uint32_t hash;
 	int error;
 
-	if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') {
+	if (cnp->cn_namelen == 2 &&
+	    cnp->cn_nameptr[0] == '.' && cnp->cn_nameptr[1] == '.') {
 		counter_u64_add(dotdothits, 1);
 		dvlp = VP2VNODELOCK(dvp);
 		dvlp2 = NULL;
@@ -1219,7 +1220,8 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st
 retry:
 	blp = NULL;
 	error = 0;
-	if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') {
+	if (cnp->cn_namelen == 2 &&
+	    cnp->cn_nameptr[0] == '.' && cnp->cn_nameptr[1] == '.') {
 		counter_u64_add(dotdothits, 1);
 		dvlp = VP2VNODELOCK(dvp);
 		dvlp2 = NULL;



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