dcache-locking-cleanup-20020624

don't oops if getDCache failed
This commit is contained in:
Pavel Semerad 2002-06-24 16:03:34 +00:00 committed by Derrick Brashear
parent 30433f36a9
commit 68de4bbb02
3 changed files with 4 additions and 4 deletions

View File

@ -258,7 +258,7 @@ tagain:
ReleaseReadLock(&avc->lock);
tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 1);
ObtainReadLock(&avc->lock);
ObtainReadLock(&tdc->lock);
if (tdc) ObtainReadLock(&tdc->lock);
}
}
@ -801,7 +801,7 @@ tagain:
ReleaseReadLock(&avc->lock);
tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 1);
ObtainReadLock(&avc->lock);
ObtainReadLock(&tdc->lock);
if (tdc) ObtainReadLock(&tdc->lock);
}
}

View File

@ -313,7 +313,7 @@ tagain:
tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1); /* test for error below */
ObtainWriteLock(&adp->lock,142);
ObtainSharedLock(&tdc->lock, 638);
if (tdc) ObtainSharedLock(&tdc->lock, 638);
/*
* Make sure that the data in the cache is current. We may have

View File

@ -125,7 +125,7 @@ afs_symlink
tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1);
volp = afs_FindVolume(&adp->fid, READ_LOCK); /*parent is also in same vol*/
ObtainWriteLock(&adp->lock,156);
ObtainWriteLock(&tdc->lock, 636);
if (tdc) ObtainWriteLock(&tdc->lock, 636);
ObtainSharedLock(&afs_xvcache,17); /* prevent others from creating this entry */
/* XXX Pay attention to afs_xvcache around the whole thing!! XXX */
do {