[OpenAFS-devel] Re: 1.3.77 on Linux 2.6.10 (Fedora Core 3 test): patches for partial success

Matthew Miller mattdm@mattdm.org
Thu, 6 Jan 2005 23:23:08 -0500


--WIyZ46R2i8wDzkSu
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Argh. Forgot actual attachments. Here they are.


openafs-1.3.77-pagefollowlinkfix.patch: fix problem in test
openafs-1.3.77-zombiefix.patch: remove mention of TASK_ZOMBIE
openafs-1.3.77-rlimlocation.patch: test for moved rlim (new patch)
crash1.txt: ls -R in /afs/grand.central.org = oops
crash2.txt: ls /afs/bu.edu = oops


-- 
Matthew Miller           mattdm@mattdm.org        <http://www.mattdm.org/>
Boston University Linux      ------>                <http://linux.bu.edu/>

--WIyZ46R2i8wDzkSu
Content-Type: text/plain; charset=us-ascii
Content-Description: fix test for page_follow_link_light
Content-Disposition: attachment; filename="openafs-1.3.77-pagefollowlinkfix.patch"

--- openafs-1.3.77/src/cf/linux-test3.m4.pagefollowlinkfix	2005-01-04 15:53:59.876475395 -0500
+++ openafs-1.3.77/src/cf/linux-test3.m4	2005-01-04 15:56:07.104503809 -0500
@@ -116,7 +116,7 @@
 AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK],[
 AC_MSG_CHECKING(for page_follow_link_light vs page_follow_link)
 save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+CPPFLAGS="-Werror-implicit-function-declaration -I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
 AC_CACHE_VAL(ac_cv_linux_kernel_page_follow_link,
 [
 AC_TRY_COMPILE(
@@ -126,5 +126,5 @@
   ],
   ac_cv_linux_kernel_page_follow_link=yes,
   ac_cv_linux_kernel_page_follow_link=no)])
-AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_page)
+AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_link)
 CPPFLAGS="$save_CPPFLAGS"])

--WIyZ46R2i8wDzkSu
Content-Type: text/plain; charset=us-ascii
Content-Description: remove TASK_ZOMBIE to make things work
Content-Disposition: attachment; filename="openafs-1.3.77-zombiefix.patch"

--- openafs-1.3.77/src/afs/afs_osi.c.zombiefix	2005-01-04 11:54:59.966859105 -0500
+++ openafs-1.3.77/src/afs/afs_osi.c	2005-01-04 12:05:23.208323884 -0500
@@ -853,6 +853,11 @@
 void
 afs_osi_TraverseProcTable()
 {
+#if 0 /* Derrick Brashear says this whole function isn't necessary if you're
+         not using gcpags, which we're not, and it's br0ke with the 2.6.10
+         kernel (and recent Fedora Core kernels). See 
+         http://www.openafs.org/pipermail/openafs-info/2005-January/016032.html
+      */
     struct task_struct *p;
 
 #ifdef EXPORTED_TASKLIST_LOCK
@@ -874,6 +879,7 @@
 #ifdef EXPORTED_TASKLIST_LOCK
     read_unlock(&tasklist_lock);
 #endif
+#endif
 }
 #endif
 

--WIyZ46R2i8wDzkSu
Content-Type: text/plain; charset=us-ascii
Content-Description: detect proper rlim location (may be suspect -- I wrote this)
Content-Disposition: attachment; filename="openafs-1.3.77-rlimlocation.patch"

diff -ur openafs-1.3.77.orig/acinclude.m4 openafs-1.3.77/acinclude.m4
--- openafs-1.3.77.orig/acinclude.m4	2004-12-13 14:40:42.000000000 -0500
+++ openafs-1.3.77/acinclude.m4	2005-01-06 20:23:15.000000000 -0500
@@ -575,6 +575,8 @@
 		 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG
 		 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND
 		 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK
+		 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM
+		 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM
 		 LINUX_WHICH_MODULES
                  if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
                    AC_MSG_WARN([Cannot determine sys_call_table status. assuming it isn't exported])
@@ -706,6 +708,12 @@
 		 if test "x$ac_cv_linux_sched_struct_task_struct_has_sig" = "xyes"; then 
 		  AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIG, 1, [define if your struct task_struct has sig])
 		 fi
+		 if test "x$ac_cv_linux_sched_struct_task_struct_has_rlim" = "xyes"; then 
+		  AC_DEFINE(STRUCT_TASK_STRUCT_HAS_RLIM, 1, [define if your struct task_struct has rlim])
+		 fi
+		 if test "x$ac_cv_linux_sched_struct_task_struct_has_signal_rlim" = "xyes"; then 
+		  AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM, 1, [define if your struct task_struct has signal->rlim])
+		 fi
                 :
 		fi
 esac
--- openafs-1.3.77.orig/src/afs/LINUX/osi_machdep.h	2004-12-07 01:09:23.000000000 -0500
+++ openafs-1.3.77/src/afs/LINUX/osi_machdep.h	2005-01-06 20:45:32.133785845 -0500
@@ -47,6 +47,14 @@
 #define SIG_UNLOCK(X) spin_unlock_irq(&X->sig->siglock)
 #endif
 
+#if defined (STRUCT_TASK_STRUCT_HAS_RLIM)
+#define TASK_STRUCT_RLIM rlim
+#elif defined (STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM)
+#define TASK_STRUCT_RLIM signal->rlim
+#else
+#error Not sure what to do about rlim (should be in the Linux task struct somewhere....)
+#endif
+
 
 #define afs_hz HZ
 #include "h/sched.h"
--- openafs-1.3.77.orig/src/afs/LINUX/osi_misc.c	2004-12-07 01:12:12.000000000 -0500
+++ openafs-1.3.77/src/afs/LINUX/osi_misc.c	2005-01-06 20:46:02.515772080 -0500
@@ -138,8 +138,8 @@
     } else
 	filp->f_pos = offset;
 
-    savelim = current->rlim[RLIMIT_FSIZE].rlim_cur;
-    current->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
+    savelim = current->TASK_STRUCT_RLIM[RLIMIT_FSIZE].rlim_cur;
+    current->TASK_STRUCT_RLIM[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
 
     /* Read/Write the data. */
     TO_USER_SPACE();
@@ -151,7 +151,7 @@
 	code = asize;
     TO_KERNEL_SPACE();
 
-    current->rlim[RLIMIT_FSIZE].rlim_cur = savelim;
+    current->TASK_STRUCT_RLIM[RLIMIT_FSIZE].rlim_cur = savelim;
 
     if (code >= 0) {
 	*resid = asize - code;
@@ -173,8 +173,8 @@
     int count;
     unsigned long savelim;
 
-    savelim = current->rlim[RLIMIT_FSIZE].rlim_cur;
-    current->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
+    savelim = current->TASK_STRUCT_RLIM[RLIMIT_FSIZE].rlim_cur;
+    current->TASK_STRUCT_RLIM[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
 
     if (uiop->uio_seg == AFS_UIOSYS)
 	TO_USER_SPACE();
@@ -217,7 +217,7 @@
     if (uiop->uio_seg == AFS_UIOSYS)
 	TO_KERNEL_SPACE();
 
-    current->rlim[RLIMIT_FSIZE].rlim_cur = savelim;
+    current->TASK_STRUCT_RLIM[RLIMIT_FSIZE].rlim_cur = savelim;
 
     return code;
 }
--- openafs-1.3.77.orig/src/cf/linux-test4.m4	2004-06-21 17:54:20.000000000 -0400
+++ openafs-1.3.77/src/cf/linux-test4.m4	2005-01-06 20:25:06.000000000 -0500
@@ -392,3 +392,33 @@
 ac_cv_linux_sched_struct_task_struct_has_sighand=no)])
 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sighand)
 CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM], [
+AC_MSG_CHECKING(for rlim in struct task_struct)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_rlim,
+[
+AC_TRY_COMPILE(
+[#include <linux/sched.h>],
+[struct task_struct _tsk;
+printf("%d\n", _tsk.rlim);],
+ac_cv_linux_sched_struct_task_struct_has_rlim=yes,
+ac_cv_linux_sched_struct_task_struct_has_rlim=no)])
+AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_rlim)
+CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM], [
+AC_MSG_CHECKING(for signal->rlim in struct task_struct)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_signal_rlim,
+[
+AC_TRY_COMPILE(
+[#include <linux/sched.h>],
+[struct task_struct _tsk;
+printf("%d\n", _tsk.signal->rlim);],
+ac_cv_linux_sched_struct_task_struct_has_signal_rlim=yes,
+ac_cv_linux_sched_struct_task_struct_has_signal_rlim=no)])
+AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_signal_rlim)
+CPPFLAGS="$save_CPPFLAGS"])

--WIyZ46R2i8wDzkSu
Content-Type: text/plain; charset=us-ascii
Content-Description: crash1.txt : crash with recursive listing of /afs/grand.central.org
Content-Disposition: attachment; filename="crash1.txt"

Unable to handle kernel paging request at virtual address 0008008e
 printing eip:
c0131d35
*pde = 12d54067
Oops: 0000 [#1]
DEBUG_PAGEALLOC
Modules linked in: libafs(U) radeon parport_pc lp parport autofs4 sunrpc iptable_filter ip_tables video button battery ac md5 ipv6 usbled ohci1394 ieee1394 uhci_hcd ehci_hcd i2c_viapro i2c_core snd_via82xx snd_ac97_codec snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_page_alloc gameport snd_mpu401_uart snd_rawmidi snd_seq_device snd soundcore sk98lin floppy dm_snapshot dm_zero dm_mirror ext3 jbd dm_mod sata_promise sata_via libata sd_mod scsi_mod
CPU:    0
EIP:    0060:[<c0131d35>]    Tainted: P      VLI
EFLAGS: 00010216   (2.6.10-1.727_FC3) 
EIP is at bit_waitqueue+0x2f/0x42
eax: b9b92403   ebx: 0007ff56   ecx: 00000020   edx: 00000003
esi: e118a120   edi: e11860e4   ebp: e0ce1680   esp: d35c9c7c
ds: 007b   es: 007b   ss: 0068
Process ls (pid: 5462, threadinfo=d35c9000 task=d1837aa0)
Stack: 00000003 c0131cfb e1189f84 e0f413d0 c017a832 e1189f84 e134cbe8 c017aad6 
       e1189f84 e0f1be5b e1189f84 e0f21969 00000202 00000000 00000000 c964e120 
       00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
Call Trace:
 [<c0131cfb>] wake_up_bit+0xb/0x16
 [<e0f413d0>] afs_delete_inode+0x0/0x10 [libafs]
 [<c017a832>] generic_delete_inode+0x20a/0x224
 [<c017aad6>] iput+0x5f/0x61
 [<e0f1be5b>] afs_PutVCache+0x4c/0x93 [libafs]
 [<e0f21969>] afs_DoBulkStat+0x5f8/0x144a [libafs]
 [<e08c4b3a>] __ext3_journal_stop+0x19/0x34 [ext3]
 [<e0f0f3bc>] afs_dir_GetBlob+0xb/0x1e [libafs]
 [<e0f0f45a>] FindItem+0x5c/0xde [libafs]
 [<e0f0f20d>] afs_dir_LookupOffset+0x4c/0x53 [libafs]
 [<e0f230c6>] afs_lookup+0x90b/0xf79 [libafs]
 [<c0146a00>] kfree+0x2d/0x76
 [<e0f42ff9>] afs_linux_lookup+0x26/0x11e [libafs]
 [<c016c9a4>] real_lookup+0x5d/0xbf
 [<c016ccb2>] do_lookup+0x43/0x72
 [<c016d6fe>] link_path_walk+0xa1d/0xd7f
 [<c0144bc0>] poison_obj+0x1d/0x3d
 [<c016dcdb>] path_lookup+0xff/0x12f
 [<c016de1f>] __user_walk+0x21/0x51
 [<c01688db>] vfs_lstat+0x11/0x37
 [<c01717b6>] filldir64+0x0/0xc3
 [<c0168e34>] sys_lstat64+0xf/0x23
 [<c017aba7>] update_atime+0x6a/0x90
 [<c0171566>] vfs_readdir+0x86/0x9a
 [<c017190e>] sys_getdents64+0x95/0x9f
 [<c0103337>] syscall_call+0x7/0xb
Code: 00 00 40 c1 e9 0c c1 e1 05 c1 e0 05 09 d0 03 0d 10 8e 3f c0 69 c0 01 00 37 9e 8b 09 c1 e9 1d 8b 1c 8d 3c 2b 3f c0 b9 20 00 00 00 <2b> 8b 38 01 00 00 d3 e8 c1 e0 05 03 83 30 01 00 00 5b c3 56 89 
 

--WIyZ46R2i8wDzkSu
Content-Type: text/plain; charset=us-ascii
Content-Description: crash2.txt : crash just listin /afs/bu.edu
Content-Disposition: attachment; filename="crash2.txt"

Unable to handle kernel paging request at virtual address 0008008e
 printing eip:
c0131d35
*pde = 11616067
Oops: 0000 [#1]
DEBUG_PAGEALLOC
Modules linked in: libafs(U) radeon parport_pc lp parport autofs4 sunrpc iptable_filter ip_tables video button battery ac md5 ipv6 usbled ohci1394 ieee1394 uhci_hcd ehci_hcd i2c_viapro i2c_core snd_via82xx snd_ac97_codec snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_page_alloc gameport snd_mpu401_uart snd_rawmidi snd_seq_device snd soundcore sk98lin floppy dm_snapshot dm_zero dm_mirror ext3 jbd dm_mod sata_promise sata_via libata sd_mod scsi_mod
CPU:    0
EIP:    0060:[<c0131d35>]    Tainted: P      VLI
EFLAGS: 00010217   (2.6.10-1.727_FC3) 
EIP is at bit_waitqueue+0x2f/0x42
eax: 74cac103   ebx: 0007ff56   ecx: 00000020   edx: 00000003
esi: e1192e08   edi: e1181538   ebp: e0cd91a0   esp: d196ac7c
ds: 007b   es: 007b   ss: 0068
Process ls (pid: 5187, threadinfo=d196a000 task=cae02aa0)
Stack: 00000003 c0131cfb e1192c6c e0f413d0 c017a832 e1192c6c e134c810 c017aad6 
       e1192c6c e0f1be5b e1192c6c e0f21969 c0115bd7 00000000 00000000 cadf500c 
       00000000 00000000 00000200 00000000 00000000 00000000 00000000 00000000 
Call Trace:
 [<c0131cfb>] wake_up_bit+0xb/0x16
 [<e0f413d0>] afs_delete_inode+0x0/0x10 [libafs]
 [<c017a832>] generic_delete_inode+0x20a/0x224
 [<c017aad6>] iput+0x5f/0x61
 [<e0f1be5b>] afs_PutVCache+0x4c/0x93 [libafs]
 [<e0f21969>] afs_DoBulkStat+0x5f8/0x144a [libafs]
 [<c0115bd7>] __change_page_attr+0x2b/0x167
 [<c0115bd7>] __change_page_attr+0x2b/0x167
 [<c0115bd7>] __change_page_attr+0x2b/0x167
 [<e0f0f3bc>] afs_dir_GetBlob+0xb/0x1e [libafs]
 [<e0f0f45a>] FindItem+0x5c/0xde [libafs]
 [<e0f0f20d>] afs_dir_LookupOffset+0x4c/0x53 [libafs]
 [<e0f230c6>] afs_lookup+0x90b/0xf79 [libafs]
 [<c0115bd7>] __change_page_attr+0x2b/0x167
 [<e0f42ff9>] afs_linux_lookup+0x26/0x11e [libafs]
 [<c016c9a4>] real_lookup+0x5d/0xbf
 [<c016ccb2>] do_lookup+0x43/0x72
 [<c016d6fe>] link_path_walk+0xa1d/0xd7f
 [<c0144bc0>] poison_obj+0x1d/0x3d
 [<c016dcdb>] path_lookup+0xff/0x12f
 [<c016de1f>] __user_walk+0x21/0x51
 [<c01688db>] vfs_lstat+0x11/0x37
 [<c0168e34>] sys_lstat64+0xf/0x23
 [<c0103337>] syscall_call+0x7/0xb
Code: 00 00 40 c1 e9 0c c1 e1 05 c1 e0 05 09 d0 03 0d 10 8e 3f c0 69 c0 01 00 37 9e 8b 09 c1 e9 1d 8b 1c 8d 3c 2b 3f c0 b9 20 00 00 00 <2b> 8b 38 01 00 00 d3 e8 c1 e0 05 03 83 30 01 00 00 5b c3 56 89 

--WIyZ46R2i8wDzkSu--