Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

zfs.ko': -1 Unknown symbol in module for custom kernel CentOS5 #919

Closed
rushikeshjadhav opened this Issue Aug 31, 2012 · 13 comments

Comments

Projects
None yet
3 participants
[root@xcptest ~]# insmod /lib/modules/2.6.32.12-0.7.1.xs1.1.0.327.170596xen/addon/zfs/zfs/zfs.ko
insmod: error inserting '/lib/modules/2.6.32.12-0.7.1.xs1.1.0.327.170596xen/addon/zfs/zfs/zfs.ko': -1 Unknown symbol in module

[root@xcptest ~]# dmesg
..
..
zfs: Unknown symbol atomic32_lock
zfs: Unknown symbol atomic64_lock

Went again to compiler and tried to use option enable-atomic-spinlocks but getting configure error as

# ./configure --with-linux=/usr/src/kernels/2.6.32.12-0.7.1.xs1.1.0.327.170596xen-i686 --enable-atomic-spinlocks
configure: WARNING: unrecognized options: --enable-atomic-spinlocks

Thanks for help.

atomic32_lock is related to spl. I checked the spl source and the symbol is exported from
spl-src/module/spl/spl-atomic.c

Owner

behlendorf commented Aug 31, 2012

You should load the zfs module with modprobe zfs to ensure the dependent modules like spl.ko get loaded.

[root@xcptest tmp]# modprobe zfs ; dmesg | tail -n4
FATAL: Error inserting zfs (/lib/modules/2.6.32.12-0.7.1.xs1.1.0.327.170596xen/addon/zfs/zfs/zfs.ko): Unknown symbol in module, or unknown parameter (see dmesg)
zfs: Unknown symbol atomic32_lock
zfs: Unknown symbol atomic64_lock
zfs: Unknown symbol atomic32_lock
zfs: Unknown symbol atomic64_lock

[root@xcptest tmp]# lsmod | grep spl
spl 131822 4 zcommon,znvpair,zavl,zunicode
zlib_deflate 18748 1 spl

[root@xcptest tmp]# lsmod | grep zfs
[root@xcptest tmp]#

On reboot, I have below in dmesg

SPL: Loaded module v0.6.0-rc10
zunicode: module license 'CDDL' taints kernel.
Disabling lock debugging due to kernel taint
zfs: Unknown symbol atomic32_lock
zfs: Unknown symbol atomic64_lock
zfs: Unknown symbol atomic32_lock
zfs: Unknown symbol atomic64_lock
zfs: Unknown symbol atomic32_lock
zfs: Unknown symbol atomic64_lock

Thanks.

I tried to recompile SPL and ZFS multiple times with different flags but no luck.
The flag --enable-atomic-spinlocks is used while compiling spl module, I also tried --disable-atomic-spinlocks but it seems that the falg is forcefully gets set.

Any help on this ?

Owner

behlendorf commented Sep 10, 2012

Can you perform the following simple test.

  • Build the spl with --enable-atomic-spinlocks
  • Load the spl module
  • Check /proc/kallsyms to see if the symbol exists. grep atomic32_lock /proc/kallsyms.
0000000000000000 r __ksymtab_atomic32_lock      [spl]
0000000000000000 r __kstrtab_atomic32_lock      [spl]
0000000000000000 r __kcrctab_atomic32_lock      [spl]
0000000000000000 B atomic32_lock        [spl]

Thanks for followup.

Build the SPL with required flag.

[root@xcptest tmp]# modprobe spl
[root@xcptest tmp]# lsmod | grep spl
spl 131822 4 zcommon,znvpair,zavl,zunicode
zlib_deflate 18748 1 spl
[root@xcptest tmp]# modprobe zfs
FATAL: Error inserting zfs (/lib/modules/2.6.32.12-0.7.1.xs1.1.0.327.170596xen/addon/zfs/zfs/zfs.ko): Unknown symbol in module, or unknown parameter (see dmesg)
[root@xcptest tmp]# cat /proc/kallsyms | grep atomic32 | wc -l
0
[root@xcptest tmp]# cat /proc/kallsyms | grep atomic64 | wc -l
60
[root@xcptest tmp]#

[root@xcptest tmp]# uname -a
Linux xcptest 2.6.32.12-0.7.1.xs1.1.0.327.170596xen #1 SMP Fri Sep 16 17:45:00 EDT 2011 i686 i686 i386 GNU/Linux

Owner

behlendorf commented Sep 11, 2012

Indeed, they are missing. Can you check your spl_config.h and verify that #define ATOMIC_SPINLOCK 1 is set.

Hello,

I just checked the header file

cat spl_config.h | grep ATOMIC

#define ATOMIC_SPINLOCK 1
#define HAVE_ATOMIC64_CMPXCHG 1
#define HAVE_ATOMIC64_T 1
#define HAVE_ATOMIC64_XCHG 1

So, I think it has ATOMIC_SPINLOCK 1

Owner

behlendorf commented Sep 11, 2012

That's very strange. The only thing which might explain this is if for some reason spl_config.h isn't getting included by module/spl/spl-atomic.c. Now it's passed explicitly as a command line argument so how that's possible isn't clear. However, you can double check this by adding a debugging line as follows:

diff --git a/module/spl/spl-atomic.c b/module/spl/spl-atomic.c
index e37b969..9c59436 100644
--- a/module/spl/spl-atomic.c
+++ b/module/spl/spl-atomic.c
@@ -33,6 +33,7 @@
 #define DEBUG_SUBSYSTEM S_ATOMIC

 #ifdef ATOMIC_SPINLOCK
+#error ATOMIC_SPINLOCK is defined
 /* Global atomic lock declarations */
 DEFINE_SPINLOCK(atomic32_lock);
 DEFINE_SPINLOCK(atomic64_lock);

This should be fatal and you'll get an error when building the spl.

/home/behlendo/src/git/spl/module/spl/../../module/spl/spl-atomic.c:36:2: error: #error ATOMIC_SPINLOCK is defined

If you don't I'd like to see the output from make when your compiling the spl-atomic.c source.

Basically, when I use # make rpm then below files get generated in spl
server # ll spl*.rpm
-rw-r--r-- 1 root root 36570 Sep 12 02:08 spl-0.6.0-rc10.i386.rpm
-rw-r--r-- 1 root root 520283 Sep 12 02:08 spl-0.6.0-rc10.src.rpm
-rw-r--r-- 1 root root 1644213 Sep 12 02:08 spl-modules-0.6.0-rc10_2.6.32.12_0.7.1.xs1.1.0.327.170596xen.i386.rpm
-rw-r--r-- 1 root root 523590 Sep 12 02:07 spl-modules-0.6.0-rc10.src.rpm
-rw-r--r-- 1 root root 68388 Sep 12 02:08 spl-modules-devel-0.6.0-rc10_2.6.32.12_0.7.1.xs1.1.0.327.170596xen.i386.rpm

I suspect that spl-modules is build correct with kernel version and source but "spl" is not as it shows i386.

I have make rpm output but shall I paste here ? or you want me to paste in pastebin ?

Thanks

Member

FransUrbo commented Jun 8, 2014

@rushikeshjadhav @behlendorf Considering this is almost two years old, against an ancient version of both zfs and kernel, can we close this? Or is this still an issue?

Closing it as well.

@behlendorf behlendorf modified the milestone: 0.6.5 Nov 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment