Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 274353

Summary: net-fs/openafs-kernel-1.4.10 build fails "GPL-incompatible module libafs.ko uses GPL-only symbol '__rcu_read_unlock'"
Product: Gentoo Linux Reporter: Benedikt Reinartz <filmor>
Component: [OLD] UnspecifiedAssignee: Stefaan De Roeck (RETIRED) <stefaan>
Status: RESOLVED FIXED    
Severity: major CC: jinks, marc.c.dionne, net-fs
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: net-fs/openafs-kernel build log
paludis --info net-fs/openafs-kernel
kernel .config
Avoid code that uses rcu_read_* when they are not usable (exported GPL)
Build log with patch_rcu
Avoid rcu_read_{un}lock if exported GPL

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