[OpenAFS-devel] OpenAFS-1.2.10 on hp_ux110, hp_ux11i and ia64_hpux1122

Douglas E. Engert deengert@anl.gov
Fri, 07 Nov 2003 14:40:36 -0600


I ran into a problem on hp_ux11i which I sent in earlier this week
where the kernel would panic on startup of afsd. I believe this is 
caused by recent maintenance to the HP system.    

Based on suggestions from IBM with their AFS version, I have added a fix to 
rx/rx_kcommon.c 

I have also rebuilt the distributions for hp_ux110, hp_ux11i, and ia64_hpux1122
which you can find at /afs/anl.gov/usr/ctd/b17783/OpenAFS-1.2.10 This should
be readable. There you will find a README the patches and three subdirectores.
In each sub directory the config script used, and the output of configure,
make dest and the @sys.tar.gz of the dest.  


Two of the changes are already in the CVS as STABLE12-hpux-build-fixes-20030805
the other two are new.

The first is to allocate a "struct file" for each socket in the NewSocket
routine and clean it up if afsd is shutdown. This change has been added to 
all three of the archs and appears to function correctly. (But I have not 
tries to shutdown afsd as we never do anyway.)      


--- ./src/rx/,rx_kcommon.c      Fri May 23 01:52:31 2003
+++ ./src/rx/rx_kcommon.c       Thu Nov  6 13:04:50 2003
@@ -760,6 +760,8 @@
     extern MBLKP allocb_wait(int, int);
     MBLKP bindnam;
     int addrsize = sizeof(struct sockaddr_in);
+    struct  file * fp;
+    extern struct fileops socketops;
 #endif
 #ifdef AFS_SGI65_ENV
     bhv_desc_t bhv;
@@ -773,6 +775,17 @@
 #if     defined(AFS_HPUX110_ENV)
     /* blocking socket */
     code = socreate(AF_INET, &newSocket, SOCK_DGRAM, 0, 0);
+    /* we need a file associated with the socket */
+       /* so sosend in NetSend will not fail */
+    fp = falloc();
+    if (!fp) goto bad;
+    fp->f_flag = FREAD | FWRITE;
+    fp->f_type = DTYPE_SOCKET;
+    fp->f_ops  = &socketops;
+
+    fp->f_data = (void *) newSocket;
+    newSocket->so_fp = (void *)fp;
+
 #else      /* AFS_HPUX110_ENV */
     code = socreate(AF_INET, &newSocket, SOCK_DGRAM, 0, SS_NOWAIT);
 #endif     /* else AFS_HPUX110_ENV */
@@ -888,6 +901,13 @@
 #if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
     thread_funnel_switch(KERNEL_FUNNEL, NETWORK_FUNNEL);
 #endif
+#ifdef AFS_HPUX110_ENV
+       if (asocket->so_fp) {
+               struct file * fp = asocket->so_fp;
+               FPENTRYFREE(fp);
+               asocket->so_fp = NULL;
+       }
+#endif /* AFS_HPUX110_ENV */
     soclose(asocket);
 #if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
     thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL);



The second new change is for ia64_hpux1122 only to turn off optimization 
in the lwp as klog could segfault when it was exiting.  

--- ./src/config/,Makefile.ia64_hpux1122.in     Fri May 23 01:52:21 2003
+++ ./src/config/Makefile.ia64_hpux1122.in      Thu Nov  6 10:58:15 2003
@@ -19,7 +19,7 @@
 SHLIB_SUFFIX=sl
 SHLIB_LDFLAGS=-b -Bsymbolic
 SHLIB_LINKER=ld -b
-LWP_OPTMZ=-O
+LWP_OPTMZ=
 OPTMZ=-O
 DBG=-g
 RANLIB=/usr/bin/ranlib

I have these changes running on hp_ux110 using 32 and 64 bit kernels,
on hp_ux11i uisng a 64 bit kernel (I don't have a 32 bit machine) and 
on ia64_hpux1122.


-- 

 Douglas E. Engert  <DEEngert@anl.gov>
 Argonne National Laboratory
 9700 South Cass Avenue
 Argonne, Illinois  60439 
 (630) 252-5444