[OpenAFS-devel] OpenAFS 1.4.12.1 on Solaris 10 x64 - afs module uses wrong 64bit modules path

Robert Milkowski milek@task.gda.pl
Sun, 01 Aug 2010 21:24:49 +0100


Hi,

Solaris 10 x86 64bit, OpenAFS 1.4.12.1


bash-3.00# modload /kernel/fs/amd64/afs
can't load module: Operation not applicable

bash-3.00# tail -1 /var/adm/messages
Aug  1 20:08:16 unknown afs: [ID 718928 kern.notice] misc/nfssrv module 
must be loaded before loading afs with nfs-xlator


I believe the responsible part of the code is:

openafs-1.4.12.1/src/afs/SOLARIS/osi_vfsops.c
[...]
     530 #ifndef AFS_NONFSTRANS
     531 #if     defined(AFS_SUN55_ENV)
     532     if ((!(mp = mod_find_by_filename("misc", "nfssrv"))
     533 && !(mp = mod_find_by_filename(NULL, NFSSRV))
     534 && !(mp = mod_find_by_filename(NULL, NFSSRV_V9))) || (mp
     535 && !mp->
     536 
mod_installed))
     537     {
     538         printf
     539             ("misc/nfssrv module must be loaded before loading 
afs with nfs-xlator\n");
     540         return (ENOSYS);
     541     }
[...]

NFSSRV_V9 is definied as:

$ grep NFSSRV_ afs/SOLARIS/osi_machdep.h
#define NFSSRV_V9     "/kernel/misc/sparcv9/nfssrv"

This is of course fine only on SPARC systems and not on x86/64bit.


Before I run modload I also run in another terminal:

bash-3.00# dtrace -n fbt::mod_find_by_filename:entry'{;printf("%s\n", 
stringof(arg1));}' \
                                 -n 
fbt::mod_find_by_filename:return'{printf("rc: %d\n", (uint)arg1);}' -q
ufs
rc: 2159728208
nfssrv
rc: 0
/kernel/misc/nfssrv
rc: 0
/kernel/misc/sparcv9/nfssrv
rc: 0

As expected mod_find_by_filename() can't match nfssrv in any provided 
paths as it should be looking for misc/amd64/nfssrv.

I hacked the /kernel/fs/amd64/afs binary so it points to 
/kernel/misc/amd64/nfssrv and now it loads fine:

bash-3.00# modload /kernel/fs/amd64/afs
bash-3.00#

bash-3.00# dtrace -n fbt::mod_find_by_filename:entry'{;printf("%s\n", 
stringof(arg1));}' \
                                 -n 
fbt::mod_find_by_filename:return'{printf("rc: %d\n", (uint)arg1);}' -q

ufs
rc: 2159728208
nfssrv
rc: 0
/kernel/misc/nfssrv
rc: 0
/kernel/misc/amd64/nfssrv
rc: 2295909344


bash-3.00# modinfo | grep afs
243 fffffffff66f0000  c02f8  65   1  afs (afs syscall interface)
243 fffffffff66f0000  c02f8  65   1  afs (afs syscall interface(32 bit))
243 fffffffff66f0000  c02f8  24   1  afs (afs filesystem)
bash-3.00#


I checked the 1.5.75 release and it looks like there is the same issue 
there.


-- 
Robert Milkowski
http://milek.blogspot.com