Date: Wed, 16 May 2012 10:44:09 +0000 (UTC) From: Gleb Kurtsou <gleb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r235503 - in head/sys: fs/unionfs kern Message-ID: <201205161044.q4GAi91b038841@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gleb Date: Wed May 16 10:44:09 2012 New Revision: 235503 URL: http://svn.freebsd.org/changeset/base/235503 Log: Skip directory entries with zero inode number during traversal. Entries with zero inode number are considered placeholders by libc and UFS. Fix remaining uses of VOP_READDIR in kernel: vop_stdvptocnp, unionfs. Sponsored by: Google Summer of Code 2011 Modified: head/sys/fs/unionfs/union_subr.c head/sys/kern/vfs_default.c Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Wed May 16 09:03:29 2012 (r235502) +++ head/sys/fs/unionfs/union_subr.c Wed May 16 10:44:09 2012 (r235503) @@ -1184,7 +1184,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: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Wed May 16 09:03:29 2012 (r235502) +++ head/sys/kern/vfs_default.c Wed May 16 10:44:09 2012 (r235503) @@ -343,8 +343,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?201205161044.q4GAi91b038841>