STABLE14-darwin-finalizevnode-get-vnode-inside-lock-20071017

FIXES 41550

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


(cherry picked from commit 49630f2957)
This commit is contained in:
Chaskiel M Grundman 2007-10-17 18:19:02 +00:00 committed by Derrick Brashear
parent 87cebf4918
commit ce7c271652

View File

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