]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Under Solaris, only clean up the open count in VOP_INACTIVE when
authorNickolai Zeldovich <kolya@mit.edu>
Thu, 14 Nov 2002 21:58:40 +0000 (21:58 +0000)
committerGarry Zacheiss <zacheiss@mit.edu>
Thu, 14 Nov 2002 21:58:40 +0000 (21:58 +0000)
the vcache is mvstat 0 (necessary because executables don't get
VOP_CLOSE'd).  Volume roots (mvstat 2) need to keep their open
counts, because under fakestat, the mountpoint above it is still
considered open by the kernel.

(cherry picked from commit 038d4a0e8e0520bf8c29793d810f0c0a6e40e419)

src/afs/SOLARIS/osi_vnodeops.c

index 1a7218c1c91a6bc1283262160a869ad4bfdb3037..fe5ed936d1d9f588d4771ddf5516dff89027e553 100644 (file)
@@ -1935,12 +1935,17 @@ void afs_inactive(struct vcache *avc, struct AFS_UCRED *acred)
         mutex_exit(&vp->v_lock);
         return;
     }  
-    mutex_exit(&vp->v_lock);    
+    mutex_exit(&vp->v_lock);
+
     /*
-     * Solaris calls VOP_OPEN on exec, but isn't very diligent about calling
-     * VOP_CLOSE when executable exits.
+     * Solaris calls VOP_OPEN on exec, but doesn't call VOP_CLOSE when
+     * the executable exits.  So we clean up the open count here.
+     *
+     * Only do this for mvstat 0 vnodes: when using fakestat, we can't
+     * lose the open count for volume roots (mvstat 2), even though they
+     * will get VOP_INACTIVE'd when released by afs_PutFakeStat().
      */
-    if (avc->opens > 0 && !(avc->states & CCore))
+    if (avc->opens > 0 && avc->mvstat == 0 && !(avc->states & CCore))
        avc->opens = avc->execsOrWriters = 0;
 
     afs_InactiveVCache(avc, acred);