svn commit: r225193 - in projects/ino64/sys: fs/unionfs kern

Matthew D Fleming mdf at FreeBSD.org
Fri Aug 26 17:02:54 UTC 2011


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;
 		}


More information about the svn-src-projects mailing list