Assert that nullfs vnode has VV_ROOT set whenever lower vnode has.

Assert that dotdot lookup on the root vnode is not performed.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2014-07-28 14:20:31 +00:00
parent 8b1932a845
commit 0ebe0000b6

View File

@ -372,6 +372,10 @@ null_lookup(struct vop_lookup_args *ap)
*/
ldvp = NULLVPTOLOWERVP(dvp);
vp = lvp = NULL;
KASSERT((ldvp->v_vflag & VV_ROOT) == 0 ||
((dvp->v_vflag & VV_ROOT) != 0 && (flags & ISDOTDOT) == 0),
("ldvp %p fl %#x dvp %p fl %#x flags %#x", ldvp, ldvp->v_vflag,
dvp, dvp->v_vflag, flags));
error = VOP_LOOKUP(ldvp, &lvp, cnp);
if (error == EJUSTRETURN && (flags & ISLASTCN) &&
(dvp->v_mount->mnt_flag & MNT_RDONLY) &&