svn commit: r325268 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Wed Nov 1 08:40:05 UTC 2017


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;


More information about the svn-src-head mailing list