[LU-9698] osd-ldiskfs: unknown symbol error on patched kernel Created: 21/Jun/17  Updated: 05/Aug/20  Resolved: 18/Sep/17

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: CEA Assignee: Oleg Drokin
Resolution: Won't Fix Votes: 0
Labels: None
Environment:

Centos6 - patched kernel


Issue Links:
Related
is related to LU-20 patchless server kernel Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Running llmount.sh from master with a patched kernel fails with:

$> llmount.sh
[...]
insmod: error inserting '/home/user/lustre-release/lustre/tests/../osd-ldiskfs/osd_ldiskfs.ko': -1 Unknown symbol in module

Output of dmesg:

$> dmesg | tail -1
osd_diskfs Unknown symbol kallsyms_lookup_name (err 0)

The problem appears after commit 0f0a43b



 Comments   
Comment by Peter Jones [ 21/Jun/17 ]

Oleg

Could you please advise?

Thanks

Peter

Comment by Oleg Drokin [ 21/Jun/17 ]

That's really strange.
What's your kernel config esp. in relation to CONFIG_KALLSYMS* ?
LLNL builder built the patch that introduced this and it pass: https://review.whamcloud.com/#/c/27549/
http://build.lustre.org/builders/CentOS%206.8%20x86_64%20%28BUILD%29/builds/5549

Comment by Quentin Bouget [ 22/Jun/17 ]
$> cat /boot/config-2.6.32.573.18.1.el6_lustre | grep KALLSYM
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_KALLSYMS_EXTRA_PASS=y

It builds alright on my machine, it's just the insmod part that doesn't work. I don't know if LLNL builder tries to run llmount.sh, it if does, it is indeed strange...
For the record, I patched the kernel myself following the procedure on the wiki a while ago.

Comment by Oleg Drokin [ 22/Jun/17 ]

Hm, so I just looked and it appears that kallsyms_lookup_name is just not exported on rhel6 at all.
I guess we can have a configure check to totally disable this functionality on rhel6 esp since on master we don't really support rhel6 anymore.

Comment by Quentin Bouget [ 23/Jun/17 ]

> esp since on master we don't really support rhel6 anymore

I'll switch to rhel7 then =]

Comment by Gerrit Updater [ 28/Jun/17 ]

Oleg Drokin (oleg.drokin@intel.com) uploaded a new patch: https://review.whamcloud.com/27874
Subject: LU-9698 osd-ldiskfs: See if kallsyms_lookup_name is exported
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 38e08695753f0511c2cab5109a2411ef43495ad1

Comment by Andreas Dilger [ 28/Jun/17 ]

It looks like RHEL6 has EXPORT_SYMBOL_GPL(kallsyms_on_each_symbol) that could be used for doing the symbol lookup, like:

#ifndef HAVE_KALLSYMS_LOOKUP_NAME
int kallsyms_strcmp(void *name, const char *symbol_name, struct module *, unsigned long symbol_address)
{
        return strcmp(name, symbol_name) == 0 ? symbol_address : 0;
}

/* Note that kallsyms_strcmp() cannot return the full symbol address, only the low 32 bits.
 * We can handle this by extracting the high word from some other kernel function */
unsigned long ll_kallsyms_lookup_name(const char *name)
{
        unsigned int low_addr = kallsyms_on_each_symbol(kallsyms_strcmp, name);

        return low_addr ? kallsyms_on_each_symbol & 0xffffffff00000000ULL | low_addr : 0;
}
#else
#define ll_kallsyms_lookup_name(name) kallsyms_lookup_name(name)
#endif
Comment by James A Simmons [ 29/Jul/17 ]

Now that https://review.whamcloud.com/28029 which Bob had RHEL6.9 kernel include a patch to export kallsyms when build RHEL kernel. This is fine since RHEL6 kernels will never be patchless like RHEL7 kernels. We should be able to close this since this is the case?

Comment by Peter Jones [ 18/Sep/17 ]

I agree James

Generated at Sat Feb 10 02:28:27 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.