From 12e6cb20530b287d2c9594b0d3e56f8ef00fe0c2 Mon Sep 17 00:00:00 2001 From: Nickolai Zeldovich Date: Thu, 14 Nov 2002 21:58:40 +0000 Subject: [PATCH] Under Solaris, only clean up the open count in VOP_INACTIVE when 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 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/afs/SOLARIS/osi_vnodeops.c b/src/afs/SOLARIS/osi_vnodeops.c index 1a7218c1c..fe5ed936d 100644 --- a/src/afs/SOLARIS/osi_vnodeops.c +++ b/src/afs/SOLARIS/osi_vnodeops.c @@ -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); -- 2.39.5