thanks to whichever of jhutz@cmu.edu or cg2v@andrew.cmu.edu (or both)
noticed the race; also deal with wrap problem in VolumeCacheCheck that i
noticed
/* Check that the vnode hasn't been removed while we were obtaining
the lock */
VNLog(102, 2, vnodeNumber, (afs_int32) vnp);
- if (vnp->disk.type == vNull) {
+ if ((vnp->disk.type == vNull) || (vnp->cacheCheck == 0)){
if (vnp->nUsers-- == 1)
StickOnLruChain_r(vnp,vcp);
if (locktype == READ_LOCK)
IH_INIT(vp->linkHandle, partp->device, header->parent,
header->linkTable);
vp->cacheCheck = ++VolumeCacheCheck;
+ /* just in case this ever rolls over */
+ if (!vp->cacheCheck)
+ vp->cacheCheck = ++VolumeCacheCheck;
vp->shuttingDown = 0;
vp->goingOffline = 0;
vp->nUsers = 1;