[OpenAFS-devel] possible solution for iput issue... (also tra nsarc #60276)

Chas Williams chas@cmf.nrl.navy.mil
Mon, 16 Apr 2001 14:28:35 -0400


In message <F349BC4F5799D411ACE100D0B706B3BB34280F@umr-mail03.cc.umr.edu>,"Neul
inger, Nathan" writes:
>Actually no... every one that I've seen had avc == vcp. The issue is that no
>matter what happens, if it does the afs_lookup, i_count gets incremented and
>never decremented. 

i think i see what's going on here.  when the parent id is possibly 'bad'
(for whatever reason)  check_bad_parent does another lookup on the 
entity.  this will create another reference to the inode (avc).  and yes,
no one releases this reference.  avc and vcp should be the same vnode,
but that's only because afs uses a static inode cache, otherwise you could
think of avc as a new inode that never gets iput.  a likely patch would be
(i also took the liberty of adding a crfree which i think is missing):


Index: osi_misc.c
===================================================================
RCS file: /afs/cmf/project/cvsroot/openafs/src/afs/LINUX/osi_misc.c,v
retrieving revision 1.8
diff -u -r1.8 osi_misc.c
--- osi_misc.c  2001/03/31 22:46:36     1.8
+++ osi_misc.c  2001/04/16 18:15:03
@@ -412,6 +413,9 @@
                 ICL_TYPE_POINTER, avc,
                 ICL_TYPE_POINTER, dp);
     }
+    if (avc)
+       AFS_RELE(avc);
+    crfree(credp);
     
   } /* if bad parent */