[OpenAFS] OpenAFS 1.6.0pre5 (or pre4) and "Unknown symbol"

Harald Barth haba@kth.se
Fri, 06 May 2011 17:18:40 +0200 (CEST)

I am just testing 1.6.0pre5 and want to tell you about the strange
module load problems I had and what caused it. When trying to insmod
or modload libafs.ko (sometimes named openafs.ko) I got the following
error messages:

kernel: libafs: Unknown symbol find_exported_dentry
kernel: libafs: Unknown symbol export_op_default

In the openafs jabber I learned quick that this is due to that I am
lacking exportfs.ko which libafs.ko nowadays depends on. Ok. I did
modload exportfs.ko and _it_did_not_change_a_thing_.


Several persons searched a long time until we finally found the problem:

As we have infinband stuff here, we have some ofed related rpms
installed. One of these installed an exportfs.ko into
which was effectively preventing the normal one
/lib/modules/2.6.18-194.17.4.el5.pdc1/kernel/fs/exportfs/exportfs.ko to load
with modprobe.


When you know it, it's quite easy to see which one is the one you
want, here the two exportfs.ko I had installed:

# nm -o /lib/modules/2.6.18-194.17.4.el5.pdc1/updates/kernel/fs/exportfs/exportfs.ko | awk '$2 ~ /[A-T]/'
/lib/modules/2.6.18-194.17.4.el5.pdc1/updates/kernel/fs/exportfs/exportfs.ko:0000000025b33839 A __crc_exportfs_decode_fh
/lib/modules/2.6.18-194.17.4.el5.pdc1/updates/kernel/fs/exportfs/exportfs.ko:00000000c7f4b81f A __crc_exportfs_encode_fh
/lib/modules/2.6.18-194.17.4.el5.pdc1/updates/kernel/fs/exportfs/exportfs.ko:000000000f7ef68b A __crc_find_exported_dentry
/lib/modules/2.6.18-194.17.4.el5.pdc1/updates/kernel/fs/exportfs/exportfs.ko:0000000000000000 D __this_module
/lib/modules/2.6.18-194.17.4.el5.pdc1/updates/kernel/fs/exportfs/exportfs.ko:0000000000000794 T exportfs_decode_fh
/lib/modules/2.6.18-194.17.4.el5.pdc1/updates/kernel/fs/exportfs/exportfs.ko:0000000000000000 T exportfs_encode_fh
/lib/modules/2.6.18-194.17.4.el5.pdc1/updates/kernel/fs/exportfs/exportfs.ko:0000000000000522 T find_exported_dentry

# nm -o /lib/modules/2.6.18-194.17.4.el5.pdc1/kernel/fs/exportfs/exportfs.ko | awk '$2 ~ /[A-T]/'
/lib/modules/2.6.18-194.17.4.el5.pdc1/kernel/fs/exportfs/exportfs.ko:00000000e5ef6aed A __crc_export_op_default
/lib/modules/2.6.18-194.17.4.el5.pdc1/kernel/fs/exportfs/exportfs.ko:00000000aa33c5ac A __crc_find_exported_dentry
/lib/modules/2.6.18-194.17.4.el5.pdc1/kernel/fs/exportfs/exportfs.ko:0000000000000000 D __this_module
/lib/modules/2.6.18-194.17.4.el5.pdc1/kernel/fs/exportfs/exportfs.ko:0000000000000000 D export_op_default
/lib/modules/2.6.18-194.17.4.el5.pdc1/kernel/fs/exportfs/exportfs.ko:0000000000000328 T find_exported_dentry

As you see, the symbols in the second one match the error message.
>From this, you still can not see if the symbols are exported free for
everyone to use or if they are only exported GPL-ONLY, but at least 
you can see that the right symbols are there. I unloaded exportfs
and then loaded _the_specific_exportfs_:

insmod /lib/modules/2.6.18-194.17.4.el5.pdc1/kernel/fs/exportfs/exportfs.ko

and then, libafs.ko would load as well as it should. 


Now I can go back to really testing things like reading and writing