diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -385,7 +385,7 @@ { struct componentname *cnp = ap->a_cnp; struct vnode *dvp = ap->a_dvp; - int flags = cnp->cn_flags; + uint64_t flags = cnp->cn_flags, old_cm; struct vnode *vp, *ldvp, *lvp; struct mount *mp; int error; @@ -411,8 +411,8 @@ */ if ((ldvp->v_vflag & VV_ROOT) != 0 && (flags & ISDOTDOT) != 0) { KASSERT((dvp->v_vflag & VV_ROOT) == 0, - ("ldvp %p fl %#x dvp %p fl %#x flags %#x", - ldvp, ldvp->v_vflag, dvp, dvp->v_vflag, flags)); + ("ldvp %p fl %#x dvp %p fl %#x flags %#jx", + ldvp, ldvp->v_vflag, dvp, dvp->v_vflag, (uintmax_t)flags)); return (ENOENT); } @@ -423,7 +423,10 @@ */ vhold(ldvp); + old_cm = ~NOCROSSMOUNT | (flags & NOCROSSMOUNT); + cnp->cn_flags |= NOCROSSMOUNT; error = VOP_LOOKUP(ldvp, &lvp, cnp); + cnp->cn_flags &= old_cm; /* * VOP_LOOKUP() on lower vnode may unlock ldvp, which allows