diff options
author | bp <bp@FreeBSD.org> | 2001-05-17 04:58:25 +0000 |
---|---|---|
committer | bp <bp@FreeBSD.org> | 2001-05-17 04:58:25 +0000 |
commit | d0e9de09009e42b055519d6f84f39664cc3ca496 (patch) | |
tree | 4f2dd19be854ea8ff48e2e7cbaf9c113e6fa047f /sys/fs | |
parent | 61ab4d4ff9c07e0bd5afbcf54f3dadc84de11c31 (diff) | |
download | FreeBSD-src-d0e9de09009e42b055519d6f84f39664cc3ca496.zip FreeBSD-src-d0e9de09009e42b055519d6f84f39664cc3ca496.tar.gz |
VOP getwritemount() can be invoked on vnodes with VFREE flag set (used in
snapshots code). At this point upper vp may not exist.
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/unionfs/union_vnops.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index ec72244..93922ec 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -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)); } /* |