From a608cd2e24e50026c36148eb357c03d583384dde Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Sat, 28 Jul 2007 15:31:44 +0000 Subject: [PATCH] darwin-avoid-fsref-panic-maybe-20070728 maybe this works. --- src/afs/DARWIN/osi_vnodeops.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c index c3dc92c24a..494a11ecca 100644 --- a/src/afs/DARWIN/osi_vnodeops.c +++ b/src/afs/DARWIN/osi_vnodeops.c @@ -2096,11 +2096,13 @@ afs_darwin_finalizevnode(struct vcache *avc, struct vnode *dvp, struct component par.vnfs_markroot = 1; error = vnode_create(VNCREATE_FLAVOR, VCREATESIZE, &par, &nvp); if (!error) { - vnode_addfsref(nvp); - avc->v = nvp; - avc->states &=~ CDeadVnode; - vnode_clearfsnode(ovp); - vnode_removefsref(ovp); + vnode_addfsref(nvp); + avc->v = nvp; + avc->states &=~ CDeadVnode; + if (!(avc->states & CVInit)) { + vnode_clearfsnode(ovp); + vnode_removefsref(ovp); + } } AFS_GLOCK(); ReleaseWriteLock(&avc->lock);