darwin-finalizevnode-get-vnode-inside-lock-20071017
authorChaskiel M Grundman <cg2v@andrew.cmu.edu>
Wed, 17 Oct 2007 18:16:19 +0000 (18:16 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 17 Oct 2007 18:16:19 +0000 (18:16 +0000)
FIXES 41550

the ovp initialization should happen while we have the vnode locked, regardless.

src/afs/DARWIN/osi_vnodeops.c

index 7e8b2a9..4b5cc8b 100644 (file)
@@ -2061,12 +2061,13 @@ afs_darwin_getnewvnode(struct vcache *avc)
    Don't touch! */
 int 
 afs_darwin_finalizevnode(struct vcache *avc, struct vnode *dvp, struct componentname *cnp, int isroot) {
-   vnode_t ovp = AFSTOV(avc);
+   vnode_t ovp;
    vnode_t nvp;
    int error;
    struct vnode_fsparam par;
    AFS_GLOCK();
    ObtainWriteLock(&avc->lock,325);
+   ovp = AFSTOV(avc);
    if (!(avc->states & CDeadVnode) && vnode_vtype(ovp) != VNON) {
         ReleaseWriteLock(&avc->lock);
         AFS_GUNLOCK();