[DRBD-user] building v9

Christoph Böhmwalder christoph.boehmwalder at linbit.com
Thu Dec 10 13:07:29 CET 2020


Hi Pierre,

As much as we may want it, DRBD's coccinelle-based compat system is not 
a general purpose solution. We can't guarantee that DRBD will build for 
any given kernel – there is simply too much going on in the block layer 
and other parts of the kernel, so that we cannnot possibly cover for all 
those different combinations (and still expect DRBD to work as intended).

So we have made a bit of a compromise: we build and test DRBD for a 
defined set of kernels. These are deemed "most interesting", according 
to the opinion of LINBIT and our customers. Namely, we currently build 
for these 125 kernels on the amd64 architecture at time of writing:

Distribution          | Kernel Version
------------          | --------------
amazonlinux2.0-amd64  | 4.14.128-112.105.amzn2
debian-buster-amd64   | 4.19.0-5; 4.19.0-6; 4.19.0-8
debian-jessie-amd64   | 3.16.0-4; 3.16.0-5; 3.16.0-6
debian-stretch-amd64  | 4.9.0-6; 4.9.0-7; 4.9.0-8; 4.9.0-9; 4.9.0-11
oracle6.0-amd64       | 4.1.12-124.26.3.el6uek; 4.1.12-124.21.1.el6uek
oracle7.0-amd64       | 4.14.35-1844.1.3.el7uek; 4.1.12-94.3.9.el7uek; 
4.1.12-124.26.10.el7uek; 4.14.35-1902.4.8.el7uek; 4.14.35-1818.3.3.el7uek
oracle8.0-amd64       | 5.4.17-2011.0.7.el8uek
rhel6.10-amd64        | 2.6.32-754.el6
rhel6.6-amd64         | 2.6.32-504.el6
rhel6.7-amd64         | 2.6.32-573.1.1.el6
rhel6.8-amd64         | 2.6.32-642.1.1.el6
rhel6.9-amd64         | 2.6.32-696.el6; 2.6.32-696.23.1.el6; 
2.6.32-696.30.1.el6
rhel7-xen-amd64       | 4.9.188-35.el7; 4.9.199-35.el7; 4.9.206-36.el7; 
4.9.212-36.el7; 4.9.215-36.el7
rhel7.0-amd64         | 3.10.0-123.20.1.el7
rhel7.1-amd64         | 3.10.0-229.1.2.el7
rhel7.2-amd64         | 3.10.0-327.el7
rhel7.3-amd64         | 3.10.0-514.6.2.el7; 3.10.0-514.36.5.el7
rhel7.4-amd64         | 3.10.0-693.el7; 3.10.0-693.17.1.el7; 
3.10.0-693.21.1.el7
rhel7.5-amd64         | 3.10.0-862.el7
rhel7.6-amd64         | 3.10.0-957.el7
rhel7.7-amd64         | 3.10.0-1049.el7; 3.10.0-1062.el7
rhel7.8-amd64         | 3.10.0-1127.el7
rhel7.9-amd64         | 3.10.0-1160.el7
rhel8.0-amd64         | 4.18.0-80.1.2.el8_0
rhel8.1-amd64         | 4.18.0-147.el8
rhel8.2-amd64         | 4.18.0-193.el8
rhel8.3-amd64         | 4.18.0-240.1.1.el8_3
sles11-sp4-amd64      | 3.0.101-108.13.1
sles12-sp2-amd64      | 4.4.74-92.38.1
sles12-sp3-amd64      | 4.4.92-6.30.1
sles12-sp4-amd64      | 4.12.14-95.3.1
sles12-sp5-amd64      | 4.12.14-120.1
sles15-sp0-amd64      | 4.12.14-25.25.1
sles15-sp1-amd64      | 4.12.14-197.29
sles15-sp2-amd64      | 5.3.18-22.2
ubuntu-bionic-amd64   | ✗ 5.3.0-1034-aws; ✗ 5.3.0-1035-aws; 
5.4.0-1025-aws; 5.4.0-1028-aws; 5.4.0-1029-aws; 5.4.0-1030-aws; 
4.15.0-1007-aws
ubuntu-bionic-amd64   | ✗ 5.3.0-1035-azure; ✗ 5.4.0-1023-azure; 
5.4.0-1025-azure; 5.4.0-1026-azure; 5.4.0-1031-azure; 5.4.0-1032-azure; 
4.15.0-1009-azure
ubuntu-bionic-amd64   | 4.15.0-112-lowlatency
ubuntu-bionic-amd64   | ✗ 4.15.0-118; ✗ 4.15.0-121; 4.15.0-122; 
4.15.0-123; 4.15.0-124; 4.15.0-126; 4.15.0-20
ubuntu-focal-amd64    | ✗ 5.4.0-1022-aws; ✗ 5.4.0-1024-aws; 
5.4.0-1025-aws; 5.4.0-1028-aws; 5.4.0-1029-aws; 5.4.0-1030-aws; 
5.4.0-1009-aws
ubuntu-focal-amd64    | ✗ 5.4.0-1022-azure; ✗ 5.4.0-1023-azure; 
5.4.0-1025-azure; 5.4.0-1026-azure; 5.4.0-1031-azure; 5.4.0-1032-azure; 
5.4.0-1010-azure
ubuntu-focal-amd64    | ✗ 5.4.0-51; ✗ 5.4.0-52; 5.4.0-48; 5.4.0-53; 
5.4.0-54; 5.4.0-56; 5.4.0-26
ubuntu-trusty-amd64   | 4.4.0-1022-aws
ubuntu-trusty-amd64   | 3.13.0-129; 3.13.0-133; 3.13.0-139; 3.13.0-142; 
3.13.0-149
ubuntu-xenial-amd64   | 4.4.0-1092-aws; 4.4.0-1098-aws; 4.4.0-1111-aws; 
4.4.0-1114-aws; 4.4.0-1117-aws
ubuntu-xenial-amd64   | 4.13.0-1018-azure; 4.15.0-1036-azure; 
4.15.0-1040-azure
ubuntu-xenial-amd64   | ✗ 4.4.0-190; 4.4.0-193; 4.4.0-194; 4.15.0-120; 
4.15.0-123; 4.4.0-197
xenserver6.5-amd64    | 3.10.41-323
xenserver7.1-amd64    | 4.4.27-572.565306
xenserver7.2-amd64    | 4.4.52-2.1
xenserver8.0-amd64    | 4.19.19-5.0.8


Using one of these kernels will give you the smoothest experience when 
building DRBD. We actually pre-compute all compat patches for these 
kernels and put them in our release tarballs. This means that, if one of 
these kernels is detected, you will not need spatch at all and just need 
to apply a plain patch.

For a lucky set of other kernels, we have made SPAAS (spatch as a 
service). This sends a "fingerprint" of your currently running kernel's 
capabilities to LINBIT, where we can then build a compat patch 
specifically for that kernel. This also works sometimes, but again, we 
cannot possibly guarantee that this works for any given kernel (not to 
mention test it so that it actually does the right thing).

So, in conclusion, you have 2 options:

a) Use one of the kernels we already support
b) Figure out how to have DRBD build for your kernel yourself (it's not 
fun, take my word for it)
c) Become a LINBIT customer and we will gladly do it for you :)


Regarding this question:

 > PS: Coccinelle is only needed for backwards compatibility, right?  Is 
there a way to avoid its usage while using a recent enough kernel?

Yes, *theoretically* DRBD should always build against the latest kernel 
release without needing compat patches. But as I already mentioned, 
there is a lot going on in the kernel, especially in the block layer, 
and since we support so many kernels it is a huge piece of work to patch 
back any larger modifications.

So it is perfectly possible that we are lagging behind a few versions. I 
guess you can try finding the "sweet spot" where it works without 
patches. This should be somwhere around 5.9 at the moment.

Hope this helps and isn't too disappointing :)

--
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running
DRBD HA —  Disaster Recovery — Software defined Storage

On 05.12.20 04:21, Pierre-Philipp Braun wrote:
> Hello
> 
> I am having troubles building the v9 module although I tried with various releases and against many kernel versions.
> 
> With branch drbd-9.0 and drbd-9.0.26-0rc2 against stock Ubuntu 5.8.0-31-generic
> 
> In file included from /root/tp/drbd/drbd/drbd_main.c:19:
> ./include/linux/vermagic.h:6:2: error: #error "This header can be included from kernel/module.c or *.mod.c only"
>      6 | #error "This header can be included from kernel/module.c or *.mod.c only"
>        |  ^~~~~
> 
> With release drbd-9.0.25-2 against stock Ubuntu 5.8.0-31-generic
> 
> /root/tp/drbd-9.0.25-2/drbd/drbd_bitmap.c: In function 'bm_realloc_pages':
> /root/tp/drbd-9.0.25-2/drbd/drbd_bitmap.c:368:15: error: too many arguments to function '__vmalloc'
>    368 |   new_pages = __vmalloc(bytes,
>        |               ^~~~~~~~~
> 
> With branch drbd-9.0 and drbd-9.0.26-0rc2 against vanilla+reiser4 linux-5.9.11
> 
>    SPATCH   5470857a83aa446cd991bcef3cdf804a  5.9.11.xenreiser4
> make[3]: *** [Makefile:177: drbd-kernel-compat/cocci_cache/5470857a83aa446cd991bcef3cdf804a/compat.patch] Error 1
> make[2]: *** [/root/tp/drbd/drbd/Kbuild:135: /root/tp/drbd/drbd/drbd-kernel-compat/compat.patch] Error 2
> make[1]: *** [Makefile:1784: /root/tp/drbd/drbd] Error 2
> make: *** [Makefile:132: kbuild] Error 2
> 
> With release drbd-9.0.25-2 against vanilla+reiser4 linux-5.9.11
> 
>    GENPATCHNAMES   5.9.11.xenreiser4
> cat: drbd-kernel-compat/patches/claim_disk__no_link__no_claim.patch: No such file or directory
> make[3]: *** [Makefile:177: drbd-kernel-compat/cocci_cache/a89eb518bd21910d66ac3e0b5527f221/compat.patch] Error 1
> make[2]: *** [/root/tp/drbd-9.0.25-2/drbd/Kbuild:135: /root/tp/drbd-9.0.25-2/drbd/drbd-kernel-compat/compat.patch] Error 2
> make[1]: *** [Makefile:1784: /root/tp/drbd-9.0.25-2/drbd] Error 2
> make: *** [Makefile:132: kbuild] Error 2
> 
> What am I missing?  That's really hard to built and assistance would be much appreciated.
> 
> PS: Coccinelle is only needed for backwards compatibility, right?  Is there a way to avoid its usage while using a recent enough kernel?
> 
> Thanks
> 


More information about the drbd-user mailing list