Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 274353 - net-fs/openafs-kernel-1.4.10 build fails "GPL-incompatible module libafs.ko uses GPL-only symbol '__rcu_read_unlock'"
Summary: net-fs/openafs-kernel-1.4.10 build fails "GPL-incompatible module libafs.ko u...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: Stefaan De Roeck (RETIRED)
URL:
Whiteboard:
Keywords:
: 274355 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-16 13:48 UTC by Benedikt Reinartz
Modified: 2010-06-21 23:10 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
net-fs/openafs-kernel build log (1245700596-install-net-fs_openafs-kernel-1.4.10:0::gentoo.out,158.62 KB, text/plain)
2009-06-22 20:05 UTC, jINKs
Details
paludis --info net-fs/openafs-kernel (net-fs-openafs-kernel-1.4.10-info,21.46 KB, text/plain)
2009-06-22 20:07 UTC, jINKs
Details
kernel .config (config,63.37 KB, text/plain)
2009-06-24 00:04 UTC, jINKs
Details
Avoid code that uses rcu_read_* when they are not usable (exported GPL) (patch_rcu,3.09 KB, patch)
2009-06-24 14:13 UTC, Marc Dionne
Details | Diff
Build log with patch_rcu (build.log,157.98 KB, text/plain)
2009-06-24 16:33 UTC, Benedikt Reinartz
Details
Avoid rcu_read_{un}lock if exported GPL (patch_rcu,3.84 KB, text/plain)
2009-06-24 18:26 UTC, Marc Dionne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benedikt Reinartz 2009-06-16 13:48:18 UTC
+++ This bug was initially created as a clone of Bug #266710 +++

The aforementioned bug was closed, but I don't think it's resolved.

Attempting to emerge openafs-kernel against vanilla-sources-2.6.30, the build fails:
...
  LD [M]  /var/tmp/portage/net-fs/openafs-kernel-1.4.10/work/openafs-1.4.10/src/libafs/MODLOAD-2.6.29-gentoo-r1-mikeyd-MP/libafs.o                                           
  Building modules, stage 2.
  MODPOST 1 modules
FATAL: modpost: GPL-incompatible module libafs.ko uses GPL-only symbol '__rcu_read_unlock'
make[6]: *** [__modpost] Error 1
...

Reproducible: Always

Steps to Reproduce:
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-06-16 14:46:32 UTC
*** Bug 274355 has been marked as a duplicate of this bug. ***
Comment 2 jINKs 2009-06-19 14:34:06 UTC
Confirmed also with gentoo-sources-2.6.30-r1.
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-06-21 18:12:53 UTC
Please post your "emerge --info" and attach the build.log file of the failed emerge to this bug.
Comment 4 jINKs 2009-06-22 20:05:06 UTC
Created attachment 195502 [details]
net-fs/openafs-kernel build log

As one can see, the module builds just fine. It fails right after linking in the modpost script.
Comment 5 jINKs 2009-06-22 20:07:09 UTC
Created attachment 195504 [details]
paludis --info net-fs/openafs-kernel
Comment 6 Benedikt Reinartz 2009-06-22 21:48:52 UTC
It's the same if you compile it manually. You can indeed just change the license declaration to GPL and it works, but that's not really viable.

P.S.: Why has the bug been closed as fixed before?!
Comment 7 Marc Dionne 2009-06-23 23:30:19 UTC
Would it be possible to see the kernel .config when this error occurs?

I think I may have an idea of where this is coming from.
Comment 8 jINKs 2009-06-24 00:04:16 UTC
Created attachment 195613 [details]
kernel .config
Comment 9 Marc Dionne 2009-06-24 00:11:45 UTC
Thanks, I think CONFIG_PREEMPT_RCU is the source of the problem.  The good news is that we can easily work around it in the OpenAFS source.

I'll have a patch to test out a bit later.
Comment 10 Marc Dionne 2009-06-24 14:13:26 UTC
Created attachment 195659 [details, diff]
Avoid code that uses rcu_read_* when they are not usable (exported GPL)

Can anyone try out the attached patch.  
With CONFIG_PREEMPT_RCU, rcu_read_unlock is GPL only, and some new credentials macros from 2.6.29 uses it.
Comment 11 Benedikt Reinartz 2009-06-24 16:33:28 UTC
Created attachment 195667 [details]
Build log with patch_rcu

Nope, sorry, still the same error.

"nm -A *.o | grep __rcu_read_" says there are still one call each to lock and unlock in libafs.o and afs_osi.o.
Comment 12 Benedikt Reinartz 2009-06-24 16:37:16 UTC
Actually it's only afs_osi.c, lines 855 and 859 I guess.
Comment 13 Marc Dionne 2009-06-24 18:26:18 UTC
Created attachment 195678 [details]
Avoid rcu_read_{un}lock if exported GPL

Hmm, in your case you don't have keyring support enabled in your kernel.
Could you try this version of the patch?
Comment 14 Benedikt Reinartz 2009-06-24 19:21:22 UTC
(In reply to comment #13)
> Created an attachment (id=195678) [edit]
> Avoid rcu_read_{un}lock if exported GPL
> 
> Hmm, in your case you don't have keyring support enabled in your kernel.
> Could you try this version of the patch?
> 
That one worked (or at least it compiled, didn't test it yet), thank you very much :)
Comment 15 Marc Dionne 2009-06-25 01:46:31 UTC
FYI a slightly different version of this patch has been committed upstream and will be part of 1.4.11 pre-release 2.
Comment 16 Benedikt Reinartz 2009-07-21 12:02:26 UTC
1.4.11 is out, but I didn't test it yet.
Comment 17 SpanKY gentoo-dev 2010-06-21 23:10:16 UTC
openafs-kernel-1.4.12.1 should fix things