[OpenAFS] Re: libafs: Unknown symbol init_pid_ns

Jason Edgecombe jason@rampaginggeek.com
Sun, 02 Nov 2008 12:44:41 -0500


Axel Thimm wrote:
> On Sun, Nov 02, 2008 at 10:24:59AM -0500, Marc Dionne wrote:
>   
>>>> configure:6856: result: yes
>>>> configure:6859: checking if find_task_by_pid is usable
>>>> make -C /srv/atrpms.net/atrpms/kernelsrc/f9-x86_64/2.6.26.6-79.fc9-x86_64 M=/builddir/openafs-1.4.7/conftest.dir modules KBUILD_VERBOSE=1
>>>> make: Entering directory `/srv/atrpms.net/atrpms/kernelsrc/f9-x86_64/2.6.26.6-79.fc9-x86_64'
>>>> [...]
>>>>   WARNING: Symbol version dump /srv/atrpms.net/atrpms/kernelsrc/f9-x86_64/2.6.26.6-79.fc9-x86_64/Module.symvers
>>>>            is missing; modules will have no dependencies and modversions.
>>>> [...]
>>>> make: Leaving directory `/srv/atrpms.net/atrpms/kernelsrc/f9-x86_64/2.6.26.6-79.fc9-x86_64'
>>>> configure:6958: result: yes
>>>>         
>> Can you show us the source of that configure test in  
>> src/cf/linux-test4.m4, just to make sure it's what we expect?
>>     
>
> This seems to be the test:
>
> AC_DEFUN([LINUX_EXPORTS_FIND_TASK_BY_PID], [
>   AC_MSG_CHECKING([if find_task_by_pid is usable])
>   AC_CACHE_VAL([ac_cv_linux_exports_find_task_by_pid], [
>     AC_TRY_KBUILD(
> [#include <linux/sched.h>],
> [pid_t p;
> find_task_by_pid(p);],
>       ac_cv_linux_exports_find_task_by_pid=yes,
>       ac_cv_linux_exports_find_task_by_pid=no)])
>   AC_MSG_RESULT($ac_cv_linux_exports_find_task_by_pid)
>   if test "x$ac_cv_linux_exports_find_task_by_pid" = "xyes"; then
>     AC_DEFINE([EXPORTED_FIND_TASK_BY_PID], 1, [define if find_task_by_pid() is usable])
>   fi])
>
>   
>> There are several things that don't make sense here:
>> a) If init_pid_ns is not defined in your kernel, you would get an error  
>> in the modpost above.
>> b) If it is defined, it is GPL only, and you would also get an error in  
>> the modpost above.
>> c) init_pid_ns should be in your kernel anyway - I don't think it can be  
>> configured away by any kernel config option.  It is certainly there with  
>> the default Fedora .config.
>>     
>
> find_task_by_pid is in linux/sched.h alright:
>
> static inline struct task_struct *__deprecated find_task_by_pid(pid_t nr)
> {
>         return find_task_by_pid_type_ns(PIDTYPE_PID, nr, &init_pid_ns);
> }
>
> init_pid_ns is also defined.
>
>   
>> Out of curiosity I built 2.6.26.3-29.fc9 locally and the configure test  
>> (from current 1.4x CVS) gives me:
>>
>> /s/openafs/1_4_x/conftest.dir/conftest.c: In function 'conftest':
>> /s/openafs/1_4_x/conftest.dir/conftest.c:30: warning: 'p' is used  
>> uninitialized in this function
>> FATAL: modpost: GPL-incompatible module conftest.ko uses GPL-only symbol  
>> 'init_pid_ns'
>> make[1]: *** [__modpost] Error 1
>> make: *** [modules] Error 2
>>
>> .. which is what I expected, and the test for find_task_pid fails.
>>     
>
> I come to think that this is due to the kernel having been configured
> and prepared, but not built.
>
> The GPL status is coded into the object files and the check goes
> through modpost. Which sounds like it would only work if the symbol
> was really built into something.
>
> So actually this means that the error is a followup from the warning
> about a missing Module.symvers. :(
>
> Is there any way to create Module.symvers w/o building the whole
> kernel and its modules? Probably not. :( :( :(
>
> Would it make sense to patch the check to always fail find_task_pid (on
> all RHEL/Fedora platforms) as a workaround?
>
> Thanks!
>   
Hi Axel,

I had a problem where doing a "make prepare" on the kernel tree was not 
enough to build openafs for the Nokia tablets. The solution was to run 
"make modules_prepare" in the kernel tree before configuring & compiling 
openafs. "make modules_prepare" saved me from having to do a full kernel 
compile.

FYI, "make modules_prepare" was preceeded by a "make n800_defconfig" 
which should map to something in the redhat kernel build; I just don't 
know what.

Thanks go to Simon for helping me discover "make modules_prepare".

Sincerely,
Jason