mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +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;
|
||||
vnodeNumber = bitNumberToVnodeNumber(bitNumber, class);
|
||||
|
||||
vnrehash:
|
||||
VNLog(2, 1, vnodeNumber);
|
||||
/* Prepare to move it to the new hash chain */
|
||||
newHash = VNODE_HASH(vp, vnodeNumber);
|
||||
@ -349,6 +350,10 @@ VAllocVnode_r(Error * ec, Volume * vp, VnodeType type)
|
||||
VOL_UNLOCK;
|
||||
ObtainWriteLock(&vnp->lock);
|
||||
VOL_LOCK;
|
||||
if (vnp->volumePtr->cacheCheck != vnp->cacheCheck) {
|
||||
ReleaseWriteLock(&vnp->lock);
|
||||
goto vnrehash;
|
||||
}
|
||||
}
|
||||
#ifdef AFS_PTHREAD_ENV
|
||||
vnp->writer = pthread_self();
|
||||
|
Loading…
Reference in New Issue
Block a user