Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-9698

osd-ldiskfs: unknown symbol error on patched kernel

Details

    • Bug
    • Resolution: Won't Fix
    • Minor
    • None
    • None
    • None
    • Centos6 - patched kernel
    • 3
    • 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

      Attachments

        Issue Links

          Activity

            [LU-9698] osd-ldiskfs: unknown symbol error on patched kernel
            adilger Andreas Dilger added a comment - - edited

            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
            
            adilger Andreas Dilger added a comment - - edited 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

            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

            gerrit Gerrit Updater added a comment - 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

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

            I'll switch to rhel7 then =]

            bougetq Quentin Bouget (Inactive) added a comment - > esp since on master we don't really support rhel6 anymore I'll switch to rhel7 then =]
            green Oleg Drokin added a comment -

            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.

            green Oleg Drokin added a comment - 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.
            $> 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.

            bougetq Quentin Bouget (Inactive) added a comment - $> 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.
            green Oleg Drokin added a comment -

            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

            green Oleg Drokin added a comment - 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
            pjones Peter Jones added a comment -

            Oleg

            Could you please advise?

            Thanks

            Peter

            pjones Peter Jones added a comment - Oleg Could you please advise? Thanks Peter

            People

              green Oleg Drokin
              cealustre CEA
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: