diff --git a/sys/fs/nullfs/null_subr.c b/sys/fs/nullfs/null_subr.c index 74274b59393b..e0de5c8cc058 100644 --- a/sys/fs/nullfs/null_subr.c +++ b/sys/fs/nullfs/null_subr.c @@ -252,11 +252,12 @@ null_nodeget(mp, lowervp, vpp) vp->v_type = lowervp->v_type; vp->v_data = xp; vp->v_vnlock = lowervp->v_vnlock; - if (lowervp == MOUNTTONULLMOUNT(mp)->nullm_lowerrootvp) - vp->v_vflag |= VV_ROOT; error = insmntque1(vp, mp, null_insmntque_dtr, xp); if (error != 0) return (error); + if (lowervp == MOUNTTONULLMOUNT(mp)->nullm_lowerrootvp) + vp->v_vflag |= VV_ROOT; + /* * Atomically insert our new node into the hash or vget existing * if someone else has beaten us to it.