[OpenAFS] 1.4.2fc3 client on RHEL5 beta 1

Jeffrey Hutzelman jhutz@cmu.edu
Thu, 21 Sep 2006 20:51:50 -0400


On Tuesday, September 19, 2006 05:15:29 PM +0200 Stephan Wiesand
<Stephan.Wiesand@desy.de> wrote:

> This is kind of a success report:
>
> I managed to build and run the client on both i686 and x86_64.
>
> The former just worked. x86_64 made some trouble, though:
>
> There are many 32bit syscall numbers missing in the kernel headers.
> A workaround for this seems to be in CVS now, similar to what I did to
> get the module built: grab the numbers from the i686 headers and add
> #defines for them.
>
> With this hack, the module built but couldn't be loaded: "libafs: Unknown
> symbol tasklist_lock". Indeed, this seems to have been removed recently.
>
> I simply removed all the "read_[un]lock(&tasklist_lock);" statements,
> and the result is a client that apparently works under light load,
> but I'm not at all sure that this is the right solution. Any hints?

Try this (untested) patch.  It's not great, but it should get you going for
now...

diff -ru ./src/afs/LINUX/osi_probe.c /usr/tmp/O/src/afs/LINUX/osi_probe.c
--- ./src/afs/LINUX/osi_probe.c	2006-05-13 18:31:44.000000000 -0400
+++ /usr/tmp/O/src/afs/LINUX/osi_probe.c	2006-09-21 20:43:16.000000000 -0400
@@ -241,6 +241,7 @@
 extern asmlinkage long sys_exit (int) __attribute__((weak));
 extern asmlinkage long sys_open (const char *, int, int) 
__attribute__((weak));
 extern asmlinkage long sys_ioctl(unsigned int, unsigned int, unsigned 
long) __attribute__((weak));
+extern rwlock_t tasklist_lock __attribute__((weak));


 /* Structures used to control probing.  We put all the details of which
diff -ru ./src/config/param.amd64_linux26.h 
/usr/tmp/O/src/config/param.amd64_linux26.h
--- ./src/config/param.amd64_linux26.h	2005-04-24 20:02:18.000000000 -0400
+++ /usr/tmp/O/src/config/param.amd64_linux26.h	2006-09-21 
20:27:50.000000000 -0400
@@ -57,7 +57,7 @@
 #include <afs/afs_sysnames.h>
 #define AFS_USERSPACE_IP_ADDR 1
 #define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to 
override */
+#define AFS_GCPAGS       0	/* Set to Userdisabled, allow sysctl to 
override */

 #define AFSLITTLE_ENDIAN    1
 #define AFS_HAVE_FFS        1	/* Use system's ffs. */
diff -ru ./src/config/param.i386_linux26.h 
/usr/tmp/O/src/config/param.i386_linux26.h
--- ./src/config/param.i386_linux26.h	2006-03-31 00:53:00.000000000 -0500
+++ /usr/tmp/O/src/config/param.i386_linux26.h	2006-09-21 
20:27:53.000000000 -0400
@@ -58,7 +58,7 @@
 #include <afs/afs_sysnames.h>
 #define AFS_USERSPACE_IP_ADDR 1
 #define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to 
override */
+#define AFS_GCPAGS       0	/* Set to Userdisabled, allow sysctl to 
override */

 #define AFSLITTLE_ENDIAN    1
 #define AFS_HAVE_FFS        1	/* Use system's ffs. */
diff -ru ./src/rx/LINUX/rx_knet.c /usr/tmp/O/src/rx/LINUX/rx_knet.c
--- ./src/rx/LINUX/rx_knet.c	2006-03-02 01:41:23.000000000 -0500
+++ /usr/tmp/O/src/rx/LINUX/rx_knet.c	2006-09-21 20:36:36.000000000 -0400
@@ -209,9 +209,17 @@

     if (&tasklist_lock)
       read_lock(&tasklist_lock);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+    else
+      rcu_read_lock();
+#endif
     listener = find_task_by_pid(rxk_ListenerPid);
     if (&tasklist_lock)
        read_unlock(&tasklist_lock);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+    else
+      rcu_read_unlock();
+#endif
     while (rxk_ListenerPid) {
 	flush_signals(listener);
 	force_sig(SIGKILL, listener);