Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Aug 2011 17:02:53 +0000 (UTC)
From:      Matthew D Fleming <mdf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r225193 - in projects/ino64/sys: fs/unionfs kern
Message-ID:  <201108261702.p7QH2riL063402@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mdf
Date: Fri Aug 26 17:02:53 2011
New Revision: 225193
URL: http://svn.freebsd.org/changeset/base/225193

Log:
  Skip empty directory entries (entries with zero inode number) during
  name lookup.
  
  GSoC r222838.
  Code by Gleb Kurtsou.

Modified:
  projects/ino64/sys/fs/unionfs/union_subr.c
  projects/ino64/sys/kern/vfs_default.c

Modified: projects/ino64/sys/fs/unionfs/union_subr.c
==============================================================================
--- projects/ino64/sys/fs/unionfs/union_subr.c	Fri Aug 26 16:49:17 2011	(r225192)
+++ projects/ino64/sys/fs/unionfs/union_subr.c	Fri Aug 26 17:02:53 2011	(r225193)
@@ -1177,7 +1177,7 @@ unionfs_check_rmdir(struct vnode *vp, st
 		edp = (struct dirent*)&buf[sizeof(buf) - uio.uio_resid];
 		for (dp = (struct dirent*)buf; !error && dp < edp;
 		     dp = (struct dirent*)((caddr_t)dp + dp->d_reclen)) {
-			if (dp->d_type == DT_WHT ||
+			if (dp->d_type == DT_WHT || dp->d_fileno == 0 ||
 			    (dp->d_namlen == 1 && dp->d_name[0] == '.') ||
 			    (dp->d_namlen == 2 && !bcmp(dp->d_name, "..", 2)))
 				continue;

Modified: projects/ino64/sys/kern/vfs_default.c
==============================================================================
--- projects/ino64/sys/kern/vfs_default.c	Fri Aug 26 16:49:17 2011	(r225192)
+++ projects/ino64/sys/kern/vfs_default.c	Fri Aug 26 17:02:53 2011	(r225193)
@@ -339,8 +339,8 @@ dirent_exists(struct vnode *vp, const ch
 		if (error)
 			goto out;
 
-		if ((dp->d_type != DT_WHT) &&
-		    !strcmp(dp->d_name, dirname)) {
+		if (dp->d_type != DT_WHT && dp->d_fileno != 0 &&
+		    strcmp(dp->d_name, dirname) == 0) {
 			found = 1;
 			goto out;
 		}



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