]> 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>
Mon, 4 Nov 2002 08:31:47 +0000 (08:31 +0000)
committerNickolai Zeldovich <kolya@mit.edu>
Mon, 4 Nov 2002 08:31:47 +0000 (08:31 +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.

src/afs/SOLARIS/osi_vnodeops.c

index 2f379c217686cd3d079aed6bc345d00af7b07c91..6d6b9b8301a6715a68a78dde9616e9a73142fd79 100644 (file)
@@ -2012,12 +2012,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);