]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE12-vol-package-avoid-race-on-invalidating-hashed-vnode-20030111
authorDerrick Brashear <shadow@dementia.org>
Sat, 11 Jan 2003 07:44:19 +0000 (07:44 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sat, 11 Jan 2003 07:44:19 +0000 (07:44 +0000)
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
src/vol/volume.c

index bad05c47c65bf97537a848b13b3eaa14808bc461..e9ec600b83caeb7a9a71d9e0edbb73ab7d3c714c 100644 (file)
@@ -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)
index 889d9eac95aad1c735e8a5f0f90b549c12273e2d..b150504e478bc40fc6185153ffc22e7f4743d36e 100644 (file)
@@ -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;