Don't acquire an additional vnode reference to a vnode when it is opened

and then release it when it is closed: we rely on the caller to keep the
vnode around with a valid reference.  This avoids vrele() destroying the
vnode vop_close() is being called from during a call to vop_close(), and
a crash due to lockmgr recursing the vnode lock when a Coda unmount
occurs.

MFC after:	3 days
This commit is contained in:
rwatson 2008-01-19 15:39:10 +00:00
parent 735d73fd1d
commit fc2cdfa748

View File

@ -221,9 +221,6 @@ coda_open(struct vop_open_args *ap)
CODADEBUG( CODA_OPEN,myprintf(("open: vp %p result %d\n", vp, error));)
/* Keep a reference until the close comes in. */
vref(*vpp);
/* Save the vnode pointer for the cache file. */
if (cp->c_ovp == NULL) {
cp->c_ovp = vp;
@ -293,8 +290,6 @@ coda_close(struct vop_close_args *ap)
error = venus_close(vtomi(vp), &cp->c_fid, flag, cred, td->td_proc);
else error = ENODEV;
vrele(vp);
CODADEBUG(CODA_CLOSE, myprintf(("close: result %d\n",error)); )
return(error);
}