mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 21:47:45 +00:00
vnrehash-avoid-cachecheck-change-20050618
unlocking and locking lets us race and makes cacheCheck potentially go bad
This commit is contained in:
parent
fb1b339a01
commit
ea20d8d6c2
@ -321,6 +321,7 @@ VAllocVnode_r(Error * ec, Volume * vp, VnodeType type)
|
|||||||
return NULL;
|
return NULL;
|
||||||
vnodeNumber = bitNumberToVnodeNumber(bitNumber, class);
|
vnodeNumber = bitNumberToVnodeNumber(bitNumber, class);
|
||||||
|
|
||||||
|
vnrehash:
|
||||||
VNLog(2, 1, vnodeNumber);
|
VNLog(2, 1, vnodeNumber);
|
||||||
/* Prepare to move it to the new hash chain */
|
/* Prepare to move it to the new hash chain */
|
||||||
newHash = VNODE_HASH(vp, vnodeNumber);
|
newHash = VNODE_HASH(vp, vnodeNumber);
|
||||||
@ -349,6 +350,10 @@ VAllocVnode_r(Error * ec, Volume * vp, VnodeType type)
|
|||||||
VOL_UNLOCK;
|
VOL_UNLOCK;
|
||||||
ObtainWriteLock(&vnp->lock);
|
ObtainWriteLock(&vnp->lock);
|
||||||
VOL_LOCK;
|
VOL_LOCK;
|
||||||
|
if (vnp->volumePtr->cacheCheck != vnp->cacheCheck) {
|
||||||
|
ReleaseWriteLock(&vnp->lock);
|
||||||
|
goto vnrehash;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#ifdef AFS_PTHREAD_ENV
|
#ifdef AFS_PTHREAD_ENV
|
||||||
vnp->writer = pthread_self();
|
vnp->writer = pthread_self();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user