[OpenAFS] 1.3.84 oops & kernel panic

chas williams - CONTRACTOR chas@cmf.nrl.navy.mil
Thu, 09 Jun 2005 14:24:37 -0400


In message <Pine.LNX.4.62.0506080849130.29460@tassadar.physics.auth.gr>,Dimitri
s Zilaskos writes:
>                 if (inode->i_state == I_CLEAR)
>                         BUG();
> 			^^^^^^ line 1204

can you try this patch against 1.3.84.  the work done by osi_clear_inode()
is now delayed until ->destroy_inode() which is available in both 2.4 and
2.6 so both the 2.4 and 2.6 port can use the standard iput().  this problem
is the same as the recent 2.6 problem with i_state.  this should be a
"better" solution.

be sure to do a make clean since the build system doesnt catch
the dependencies on osi_machdep.h

btw, if we did remove the 2.2 code the openafs client would be quite a 
bit easier to read.

Index: src/afs/LINUX/osi_machdep.h
===================================================================
RCS file: /cvs/openafs/src/afs/LINUX/osi_machdep.h,v
retrieving revision 1.22.2.9
diff -u -u -r1.22.2.9 osi_machdep.h
--- src/afs/LINUX/osi_machdep.h	8 May 2005 05:48:40 -0000	1.22.2.9
+++ src/afs/LINUX/osi_machdep.h	9 Jun 2005 16:28:53 -0000
@@ -82,7 +82,7 @@
 #define VN_HOLD(V) ((vnode_t *) V)->i_count++
 #endif
 
-#if defined(AFS_LINUX26_ENV)
+#if defined(AFS_LINUX24_ENV)
 #define VN_RELE(V) iput((struct inode *) V)
 #else
 #define VN_RELE(V) osi_iput((struct inode *) V)
Index: src/afs/LINUX/osi_misc.c
===================================================================
RCS file: /cvs/openafs/src/afs/LINUX/osi_misc.c,v
retrieving revision 1.34.2.8
diff -u -u -r1.34.2.8 osi_misc.c
--- src/afs/LINUX/osi_misc.c	28 Apr 2005 03:11:51 -0000	1.34.2.8
+++ src/afs/LINUX/osi_misc.c	9 Jun 2005 16:28:53 -0000
@@ -363,6 +363,7 @@
     }
 }
 
+#if !defined(AFS_LINUX24_ENV)
 void
 osi_clear_inode(struct inode *ip)
 {
@@ -390,7 +391,6 @@
     crfree(credp);
 }
 
-#if !defined(AFS_LINUX26_ENV)
 /* iput an inode. Since we still have a separate inode pool, we don't want
  * to call iput on AFS inodes, since they would then end up on Linux's
  * inode_unsed list.
Index: src/afs/LINUX/osi_vfsops.c
===================================================================
RCS file: /cvs/openafs/src/afs/LINUX/osi_vfsops.c,v
retrieving revision 1.29.2.4
diff -u -u -r1.29.2.4 osi_vfsops.c
--- src/afs/LINUX/osi_vfsops.c	5 Jun 2005 15:34:42 -0000	1.29.2.4
+++ src/afs/LINUX/osi_vfsops.c	9 Jun 2005 16:28:53 -0000
@@ -287,19 +287,17 @@
 #endif
 }
 
-#if defined(AFS_LINUX26_ENV)
-static void
-afs_drop_inode(struct inode *ip)
-{
-	generic_delete_inode(ip);
-	AFS_GUNLOCK();		/* locked by afs_delete_inode() */
-}
-#endif
-
 static void
 afs_destroy_inode(struct inode *ip)
 {
+    cred_t *credp = crref();
+
+    AFS_GLOCK();
+    put_inode_on_dummy_list(ip);
     ip->i_state = 0;
+    afs_InactiveVCache(ITOAFS(ip), credp);		/* afs_FlushVCache()? */
+    AFS_GUNLOCK();
+    crfree(credp);
 }
 
 
@@ -313,10 +311,9 @@
 static void
 afs_delete_inode(struct inode *ip)
 {
-#if defined(AFS_LINUX26_ENV)
-    AFS_GLOCK();		/* after spin_unlock(inode_lock) */
-    put_inode_on_dummy_list(ip);
-    osi_clear_inode(ip);
+#if defined(AFS_LINUX24_ENV)
+    ip->i_state = I_CLEAR;
+    /* clear_inode()? */
 #else
     AFS_GLOCK();
     osi_clear_inode(ip);
@@ -413,8 +410,7 @@
 }
 
 struct super_operations afs_sops = {
-#if defined(AFS_LINUX26_ENV)
-  .drop_inode =		afs_drop_inode,
+#if defined(AFS_LINUX24_ENV)
   .destroy_inode =	afs_destroy_inode,
 #endif
   .delete_inode =	afs_delete_inode,
Index: src/afs/LINUX/osi_vnodeops.c
===================================================================
RCS file: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v
retrieving revision 1.81.2.23
diff -u -u -r1.81.2.23 osi_vnodeops.c
--- src/afs/LINUX/osi_vnodeops.c	31 May 2005 21:12:51 -0000	1.81.2.23
+++ src/afs/LINUX/osi_vnodeops.c	9 Jun 2005 16:28:53 -0000
@@ -950,7 +950,7 @@
     goto done;
 }
 
-#if !defined(AFS_LINUX26_ENV)
+#if !defined(AFS_LINUX24_ENV)
 /* afs_dentry_iput */
 static void
 afs_dentry_iput(struct dentry *dp, struct inode *ip)
@@ -971,7 +971,7 @@
 struct dentry_operations afs_dentry_operations = {
   .d_revalidate =	afs_linux_dentry_revalidate,
   .d_delete =		afs_dentry_delete,
-#if !defined(AFS_LINUX26_ENV)
+#if !defined(AFS_LINUX24_ENV)
   .d_iput =		afs_dentry_iput,
 #endif
 };