- Remove interlock protection around VI_XLOCK. The interlock is not

sufficient to guarantee that this race is not hit.  The XLOCK will likely
   have to be redesigned due to the way reference counting and mutexes work
   in FreeBSD.  We currently can not be guaranteed that xlock was not set
   and cleared while we were blocked on the interlock while waiting to check
   for XLOCK.  This would lead us to reference a vnode which was not the
   vnode we requested.
 - Add a backtrace() call inside of INVARIANTS in the hopes of finding out if
   this condition is ever hit.  It should not, since we should be retaining
   a reference to the vnode in these cases.  The reference would be sufficient
   to block recycling.
This commit is contained in:
Jeff Roberson 2003-09-19 23:37:49 +00:00
parent 302e193264
commit ce1fb23146
3 changed files with 9 additions and 10 deletions

View File

@ -607,12 +607,12 @@ nwfs_vinvalbuf(vp, flags, cred, td, intrflg)
/* struct nwmount *nmp = VTONWFS(vp);*/
int error = 0, slpflag, slptimeo;
VI_LOCK(vp);
if (vp->v_iflag & VI_XLOCK) {
VI_UNLOCK(vp);
#ifdef INVARIANTS
backtrace();
#endif
return (0);
}
VI_UNLOCK(vp);
if (intrflg) {
slpflag = PCATCH;

View File

@ -679,12 +679,12 @@ smbfs_vinvalbuf(vp, flags, cred, td, intrflg)
struct smbnode *np = VTOSMB(vp);
int error = 0, slpflag, slptimeo;
VI_LOCK(vp);
if (vp->v_iflag & VI_XLOCK) {
VI_UNLOCK(vp);
#ifdef INVARIANTS
backtrace();
#endif
return 0;
}
VI_UNLOCK(vp);
if (intrflg) {
slpflag = PCATCH;

View File

@ -1067,13 +1067,12 @@ nfs_vinvalbuf(struct vnode *vp, int flags, struct ucred *cred,
ASSERT_VOP_LOCKED(vp, "nfs_vinvalbuf");
VI_LOCK(vp);
if (vp->v_iflag & VI_XLOCK) {
/* XXX Should we wait here? */
VI_UNLOCK(vp);
#ifdef INVARIANTS
backtrace();
#endif
return (0);
}
VI_UNLOCK(vp);
if ((nmp->nm_flag & NFSMNT_INT) == 0)
intrflg = 0;