Bug#985254: openafs-modules-dkms: Fails to build on -rt / non-HIGHMEM kernels

2021-03-18 Thread Benjamin Kaduk
On Mon, Mar 15, 2021 at 06:27:41AM +, Witold Baryluk wrote:
> Package: openafs-modules-dkms
> Version: 1.8.6-5
> Followup-For: Bug #985254
> X-Debbugs-Cc: witold.bary...@gmail.com
> 
> Actually after digging more, it is not due to HIGHMEM. In fact the
> kmap_atomic takes single argument since about kernel 3.13 on all
> configurations.
> 
> 
> The issue actually is somewhere else.
> 
> In config.log I found this:
> 
> The module compiles, however it doesn't link into .ko file:
> 
> FATAL: modpost: GPL-incompatible module conftest.ko uses GPL-only symbol 
> 'migrate_disable'
> 
> And that causes configure to think that the function is not one-argument.

Thanks for taking the time to make the report and follow-up with the
additional information.

However, IIRC it is "well known" (though I did not find good documentation
in a very quick search) that the -rt kernel has many interfaces that are
GPL-only that are not GPL-only in a standard kernel, and as such incurs
license complaints against the openafs kernel module.  I don't expect to be
able to do anything about this (other, perhaps, that documenting it
better), unfortunately.

-Ben



Bug#985254: openafs-modules-dkms: Fails to build on -rt / non-HIGHMEM kernels

2021-03-15 Thread Witold Baryluk
Package: openafs-modules-dkms
Version: 1.8.6-5
Followup-For: Bug #985254
X-Debbugs-Cc: witold.bary...@gmail.com

Actually after digging more, it is not due to HIGHMEM. In fact the
kmap_atomic takes single argument since about kernel 3.13 on all
configurations.


The issue actually is somewhere else.

In config.log I found this:

The module compiles, however it doesn't link into .ko file:

FATAL: modpost: GPL-incompatible module conftest.ko uses GPL-only symbol 
'migrate_disable'

And that causes configure to think that the function is not one-argument.



Bug#985254: openafs-modules-dkms: Fails to build on -rt / non-HIGHMEM kernels

2021-03-15 Thread Witold Baryluk
Package: openafs-modules-dkms
Version: 1.8.6-5
Severity: normal
X-Debbugs-Cc: witold.bary...@gmail.com

I am pretty sure this is know issue (I was expiriencing it for probably 2
years or more), but I didn't found any open issues to track this problem.


...
checking whether kmap_atomic takes no km_type argument... no
...
...
Building in directory: MODLOAD-5.10.0-4-rt-amd64-SP
make[2]: Entering directory 
'/var/lib/dkms/openafs/1.8.6/build/src/libafs/MODLOAD-5.10.0-4-rt-amd64-SP'
...
...
  CC [M]  
/var/lib/dkms/openafs/1.8.6/build/src/libafs/MODLOAD-5.10.0-4-rt-amd64-SP/afs_bypasscache.o
/var/lib/dkms/openafs/1.8.6/build/src/libafs/MODLOAD-5.10.0-4-rt-amd64-SP/afs_bypasscache.c:
 In function ‘afs_bypass_copy_page’:
/var/lib/dkms/openafs/1.8.6/build/src/libafs/MODLOAD-5.10.0-4-rt-amd64-SP/afs_bypasscache.c:311:31:
 error: ‘KM_USER0’ undeclared (first use in this function)
  311 | address = kmap_atomic(pp, KM_USER0);
  |   ^~~~
/var/lib/dkms/openafs/1.8.6/build/src/libafs/MODLOAD-5.10.0-4-rt-amd64-SP/afs_bypasscache.c:311:31:
 note: each undeclared identifier is reported only once for each function it 
appears in
/var/lib/dkms/openafs/1.8.6/build/src/libafs/MODLOAD-5.10.0-4-rt-amd64-SP/afs_bypasscache.c:311:15:
 error: too many arguments to function ‘kmap_atomic’
  311 | address = kmap_atomic(pp, KM_USER0);
  |   ^~~
In file included from 
/usr/src/linux-headers-5.10.0-4-common-rt/include/linux/highmem.h:14,
 from 
/usr/src/linux-headers-5.10.0-4-common-rt/include/linux/pagemap.h:11,
 from 
/usr/src/linux-headers-5.10.0-4-common-rt/include/linux/blkdev.h:14,
 from 
/usr/src/linux-headers-5.10.0-4-common-rt/include/linux/backing-dev.h:15,
 from 
/var/lib/dkms/openafs/1.8.6/build/src/afs/sysincludes.h:126,
 from 
/var/lib/dkms/openafs/1.8.6/build/src/afs/afs_bypasscache.h:67,
 from 
/var/lib/dkms/openafs/1.8.6/build/src/libafs/MODLOAD-5.10.0-4-rt-amd64-SP/afs_bypasscache.c:64:
/usr/src/linux-headers-5.10.0-4-common-rt/include/linux/highmem-internal.h:179:21:
 note: declared here
  179 | static inline void *kmap_atomic(struct page *page)
  | ^~~
/var/lib/dkms/openafs/1.8.6/build/src/libafs/MODLOAD-5.10.0-4-rt-amd64-SP/afs_bypasscache.c:321:36:
 error: macro "kunmap_atomic" passed 2 arguments, but takes just 1
  321 | kunmap_atomic(address, KM_USER0);
  |^
In file included from 
/usr/src/linux-headers-5.10.0-4-common-rt/include/linux/highmem.h:14,
 from 
/usr/src/linux-headers-5.10.0-4-common-rt/include/linux/pagemap.h:11,
 from 
/usr/src/linux-headers-5.10.0-4-common-rt/include/linux/blkdev.h:14,
 from 
/usr/src/linux-headers-5.10.0-4-common-rt/include/linux/backing-dev.h:15,
 from 
/var/lib/dkms/openafs/1.8.6/build/src/afs/sysincludes.h:126,
 from 
/var/lib/dkms/openafs/1.8.6/build/src/afs/afs_bypasscache.h:67,
 from 
/var/lib/dkms/openafs/1.8.6/build/src/libafs/MODLOAD-5.10.0-4-rt-amd64-SP/afs_bypasscache.c:64:
/usr/src/linux-headers-5.10.0-4-common-rt/include/linux/highmem-internal.h:210: 
note: macro "kunmap_atomic" defined here
  210 | #define kunmap_atomic(__addr) \
  | 
/var/lib/dkms/openafs/1.8.6/build/src/libafs/MODLOAD-5.10.0-4-rt-amd64-SP/afs_bypasscache.c:321:5:
 error: ‘kunmap_atomic’ undeclared (first use in this function); did you mean 
‘kmap_atomic’?
  321 | kunmap_atomic(address, KM_USER0);
  | ^
  | kmap_atomic
make[5]: *** 
[/usr/src/linux-headers-5.10.0-4-common-rt/scripts/Makefile.build:284: 
/var/lib/dkms/openafs/1.8.6/build/src/libafs/MODLOAD-5.10.0-4-rt-amd64-SP/afs_bypasscache.o]
 Error 1
make[4]: *** [/usr/src/linux-headers-5.10.0-4-common-rt/Makefile:1813: 
/var/lib/dkms/openafs/1.8.6/build/src/libafs/MODLOAD-5.10.0-4-rt-amd64-SP] 
Error 2
make[3]: *** [/usr/src/linux-headers-5.10.0-4-common-rt/Makefile:185: 
__sub-make] Error 2
make[3]: Leaving directory '/usr/src/linux-headers-5.10.0-4-rt-amd64'
FAILURE: make exit code 2
make[2]: *** [Makefile.afs:279: openafs.ko] Error 1
make[2]: Leaving directory 
'/var/lib/dkms/openafs/1.8.6/build/src/libafs/MODLOAD-5.10.0-4-rt-amd64-SP'
make[1]: *** [Makefile:186: linux_compdirs] Error 2
make[1]: Leaving directory '/var/lib/dkms/openafs/1.8.6/build/src/libafs'
make: *** [Makefile:15: all] Error 2


The upstream code, as well the one shipped in Debian -dkms package, does
have provisions to detect this issue, and work, but it doesn't. Here is a
relevant part:


#if !defined(UKERNEL)
# if defined(KMAP_ATOMIC_TAKES_NO_KM_TYPE)
address = kmap_atomic(pp);
# else
address = kmap_atomic(pp, KM_USER0);
# endif
#else
address = pp;
#endif
memcpy(address + pageoff, (char *)(rxiov[iovno].iov_base) + iovoff, dolen);
#if !defined(UKERNEL)
# if