[OpenAFS] Re: libafs: Unknown symbol init_pid_ns

Axel Thimm openafs-info@openafs.org
Sun, 2 Nov 2008 18:44:33 +0200


--CUfgB8w4ZwR/yMy5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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=3D/builddir/openafs-1.4.7/conftest.dir modules KBUILD_VERBOSE=3D1
>>> 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 modversion=
s.
>>> [...]
>>> make: Leaving directory `/srv/atrpms.net/atrpms/kernelsrc/f9-x86_64/2.6=
=2E26.6-79.fc9-x86_64'
>>> configure:6958: result: yes
>
> Can you show us the source of that configure test in =20
> 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=3Dyes,
      ac_cv_linux_exports_find_task_by_pid=3Dno)])
  AC_MSG_RESULT($ac_cv_linux_exports_find_task_by_pid)
  if test "x$ac_cv_linux_exports_find_task_by_pid" =3D "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 =
=20
> in the modpost above.
> b) If it is defined, it is GPL only, and you would also get an error in =
=20
> the modpost above.
> c) init_pid_ns should be in your kernel anyway - I don't think it can be =
=20
> configured away by any kernel config option.  It is certainly there with =
=20
> 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 =
=20
> (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 =20
> uninitialized in this function
> FATAL: modpost: GPL-incompatible module conftest.ko uses GPL-only symbol =
=20
> '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!
--=20
Axel.Thimm at ATrpms.net

--CUfgB8w4ZwR/yMy5
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkkN2PEACgkQQBVS1GOamfFqPQCcD9RtwPdNegx9T5AuHY3JW9er
zkcAn2j62tg1XB8Trru/Vasko+flaPh2
=du3s
-----END PGP SIGNATURE-----

--CUfgB8w4ZwR/yMy5--