From 1b135c8d53505ceb674682796258fa0eead12ff8 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Sat, 11 Jan 2003 07:44:19 +0000 Subject: [PATCH] STABLE12-vol-package-avoid-race-on-invalidating-hashed-vnode-20030111 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 --- src/vol/vnode.c | 2 +- src/vol/volume.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vol/vnode.c b/src/vol/vnode.c index bad05c47c..e9ec600b8 100644 --- a/src/vol/vnode.c +++ b/src/vol/vnode.c @@ -634,7 +634,7 @@ Vnode *VGetVnode_r(ec,vp,vnodeNumber,locktype) /* 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) diff --git a/src/vol/volume.c b/src/vol/volume.c index 889d9eac9..b150504e4 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -699,6 +699,9 @@ private Volume *attach2(ec, path, header, partp, isbusy) 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; -- 2.39.5