VOP getwritemount() can be invoked on vnodes with VFREE flag set (used in

snapshots code). At this point upper vp may not exist.
This commit is contained in:
Boris Popov 2001-05-17 04:58:25 +00:00
parent 3413421bda
commit f3d1ec67b2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=76718
2 changed files with 24 additions and 8 deletions

View file

@ -1620,11 +1620,19 @@ union_getwritemount(ap)
struct mount **a_mpp;
} */ *ap;
{
struct vnode *vp = UPPERVP(ap->a_vp);
struct vnode *vp = ap->a_vp;
struct vnode *uvp = UPPERVP(vp);
if (vp == NULL)
panic("union: missing upper layer in getwritemount");
return(VOP_GETWRITEMOUNT(vp, ap->a_mpp));
if (uvp == NULL) {
VI_LOCK(vp);
if (vp->v_flag & VFREE) {
VI_UNLOCK(vp);
return (EOPNOTSUPP);
}
VI_UNLOCK(vp);
panic("union_getwritemount: missing upper layer");
}
return(VOP_GETWRITEMOUNT(uvp, ap->a_mpp));
}
/*

View file

@ -1620,11 +1620,19 @@ union_getwritemount(ap)
struct mount **a_mpp;
} */ *ap;
{
struct vnode *vp = UPPERVP(ap->a_vp);
struct vnode *vp = ap->a_vp;
struct vnode *uvp = UPPERVP(vp);
if (vp == NULL)
panic("union: missing upper layer in getwritemount");
return(VOP_GETWRITEMOUNT(vp, ap->a_mpp));
if (uvp == NULL) {
VI_LOCK(vp);
if (vp->v_flag & VFREE) {
VI_UNLOCK(vp);
return (EOPNOTSUPP);
}
VI_UNLOCK(vp);
panic("union_getwritemount: missing upper layer");
}
return(VOP_GETWRITEMOUNT(uvp, ap->a_mpp));
}
/*