svn commit: r217544 - stable/8/sys/kern
Jaakko Heinonen
jh at FreeBSD.org
Tue Jan 18 16:49:52 UTC 2011
Author: jh
Date: Tue Jan 18 16:49:51 2011
New Revision: 217544
URL: http://svn.freebsd.org/changeset/base/217544
Log:
MFC r205682:
Support only LOOKUP operation for "/" in relookup() because lookup()
can't succeed for CREATE, DELETE and RENAME.
Modified:
stable/8/sys/kern/vfs_lookup.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
Modified: stable/8/sys/kern/vfs_lookup.c
==============================================================================
--- stable/8/sys/kern/vfs_lookup.c Tue Jan 18 16:43:01 2011 (r217543)
+++ stable/8/sys/kern/vfs_lookup.c Tue Jan 18 16:49:51 2011 (r217544)
@@ -948,19 +948,17 @@ relookup(struct vnode *dvp, struct vnode
#endif
/*
- * Check for degenerate name (e.g. / or "")
- * which is a way of talking about a directory,
- * e.g. like "/." or ".".
+ * Check for "" which represents the root directory after slash
+ * removal.
*/
if (cnp->cn_nameptr[0] == '\0') {
- if (cnp->cn_nameiop != LOOKUP || wantparent) {
- error = EISDIR;
- goto bad;
- }
- if (dp->v_type != VDIR) {
- error = ENOTDIR;
- goto bad;
- }
+ /*
+ * Support only LOOKUP for "/" because lookup()
+ * can't succeed for CREATE, DELETE and RENAME.
+ */
+ KASSERT(cnp->cn_nameiop == LOOKUP, ("nameiop must be LOOKUP"));
+ KASSERT(dp->v_type == VDIR, ("dp is not a directory"));
+
if (!(cnp->cn_flags & LOCKLEAF))
VOP_UNLOCK(dp, 0);
*vpp = dp;
More information about the svn-src-stable-8
mailing list