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:
parent
3413421bda
commit
f3d1ec67b2
@ -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));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user