[OpenAFS-devel] Linux 2.6.12 kernel BUG at fs/namei.c:1189

chas williams - CONTRACTOR chas@cmf.nrl.navy.mil
Mon, 23 Jan 2006 14:14:08 -0500


In message <43D0B210.5090103@pclella.cern.ch>,Rainer Toebbicke writes:
>There is a bug in the handling of inode-cleanup (afs_put_inode) -
>prior to 1.4.0 systems would be likely to deadlock if it happened at
>the "right" time, then a patch (put-inode-speedup-20050815) went in
>that removed the lock rather abruptly and did not really consider
>whether one was required.

after thinking about this a little bit, i dont think the call to
afs_InactiveVCache() should be in .put_inode().  when the linux
vfs layer is done with a dentry it calls .d_iput().  this seems
the closest to "inactive" than checking for refCount == 2 in
.put_inode().

would this solve your problem and can you give this a try?

Index: src/afs/LINUX/osi_vfsops.c
===================================================================
RCS file: /cvs/openafs/src/afs/LINUX/osi_vfsops.c,v
retrieving revision 1.29.2.12
diff -u -u -r1.29.2.12 osi_vfsops.c
--- src/afs/LINUX/osi_vfsops.c	29 Nov 2005 03:20:28 -0000	1.29.2.12
+++ src/afs/LINUX/osi_vfsops.c	23 Jan 2006 19:08:41 -0000
@@ -332,6 +332,7 @@
 #endif
 }
 
+#ifdef notdef
 /* afs_put_inode
  * Linux version of inactive.  When refcount == 2, we are about to
  * decrement to 1 and the only reference remaining should be for
@@ -350,6 +351,7 @@
     }
     AFS_GUNLOCK();
 }
+#endif
 
 /* afs_put_super
  * Called from unmount to release super_block. */
@@ -436,7 +438,9 @@
   .destroy_inode =	afs_destroy_inode,
 #endif
   .clear_inode =	afs_clear_inode,
+#ifdef notdef
   .put_inode =		afs_put_inode,
+#endif
   .put_super =		afs_put_super,
   .statfs =		afs_statfs,
 #if !defined(AFS_LINUX24_ENV)
Index: src/afs/LINUX/osi_vnodeops.c
===================================================================
RCS file: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v
retrieving revision 1.81.2.40
diff -u -u -r1.81.2.40 osi_vnodeops.c
--- src/afs/LINUX/osi_vnodeops.c	11 Jan 2006 21:38:30 -0000	1.81.2.40
+++ src/afs/LINUX/osi_vnodeops.c	23 Jan 2006 19:08:41 -0000
@@ -788,8 +788,7 @@
     struct vcache *vcp = VTOAFS(ip);
 
     AFS_GLOCK();
-    if (vcp->states & CUnlinked)
-	(void) afs_InactiveVCache(vcp, NULL);
+    (void) afs_InactiveVCache(vcp, NULL);
     AFS_GUNLOCK();
 
     iput(ip);