<div dir="ltr">Thanks Christoph for the very clear explanation, I think that it was a piece which was missing for all of us!<br><br>B.R.<div>Yannis</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 10 Dec 2020 at 12:07, Christoph Böhmwalder &lt;<a href="mailto:christoph.boehmwalder@linbit.com">christoph.boehmwalder@linbit.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Pierre,<br>
<br>
As much as we may want it, DRBD&#39;s coccinelle-based compat system is not <br>
a general purpose solution. We can&#39;t guarantee that DRBD will build for <br>
any given kernel – there is simply too much going on in the block layer <br>
and other parts of the kernel, so that we cannnot possibly cover for all <br>
those different combinations (and still expect DRBD to work as intended).<br>
<br>
So we have made a bit of a compromise: we build and test DRBD for a <br>
defined set of kernels. These are deemed &quot;most interesting&quot;, according <br>
to the opinion of LINBIT and our customers. Namely, we currently build <br>
for these 125 kernels on the amd64 architecture at time of writing:<br>
<br>
Distribution          | Kernel Version<br>
------------          | --------------<br>
amazonlinux2.0-amd64  | 4.14.128-112.105.amzn2<br>
debian-buster-amd64   | 4.19.0-5; 4.19.0-6; 4.19.0-8<br>
debian-jessie-amd64   | 3.16.0-4; 3.16.0-5; 3.16.0-6<br>
debian-stretch-amd64  | 4.9.0-6; 4.9.0-7; 4.9.0-8; 4.9.0-9; 4.9.0-11<br>
oracle6.0-amd64       | 4.1.12-124.26.3.el6uek; 4.1.12-124.21.1.el6uek<br>
oracle7.0-amd64       | 4.14.35-1844.1.3.el7uek; 4.1.12-94.3.9.el7uek; <br>
4.1.12-124.26.10.el7uek; 4.14.35-1902.4.8.el7uek; 4.14.35-1818.3.3.el7uek<br>
oracle8.0-amd64       | 5.4.17-2011.0.7.el8uek<br>
rhel6.10-amd64        | 2.6.32-754.el6<br>
rhel6.6-amd64         | 2.6.32-504.el6<br>
rhel6.7-amd64         | 2.6.32-573.1.1.el6<br>
rhel6.8-amd64         | 2.6.32-642.1.1.el6<br>
rhel6.9-amd64         | 2.6.32-696.el6; 2.6.32-696.23.1.el6; <br>
2.6.32-696.30.1.el6<br>
rhel7-xen-amd64       | 4.9.188-35.el7; 4.9.199-35.el7; 4.9.206-36.el7; <br>
4.9.212-36.el7; 4.9.215-36.el7<br>
rhel7.0-amd64         | 3.10.0-123.20.1.el7<br>
rhel7.1-amd64         | 3.10.0-229.1.2.el7<br>
rhel7.2-amd64         | 3.10.0-327.el7<br>
rhel7.3-amd64         | 3.10.0-514.6.2.el7; 3.10.0-514.36.5.el7<br>
rhel7.4-amd64         | 3.10.0-693.el7; 3.10.0-693.17.1.el7; <br>
3.10.0-693.21.1.el7<br>
rhel7.5-amd64         | 3.10.0-862.el7<br>
rhel7.6-amd64         | 3.10.0-957.el7<br>
rhel7.7-amd64         | 3.10.0-1049.el7; 3.10.0-1062.el7<br>
rhel7.8-amd64         | 3.10.0-1127.el7<br>
rhel7.9-amd64         | 3.10.0-1160.el7<br>
rhel8.0-amd64         | 4.18.0-80.1.2.el8_0<br>
rhel8.1-amd64         | 4.18.0-147.el8<br>
rhel8.2-amd64         | 4.18.0-193.el8<br>
rhel8.3-amd64         | 4.18.0-240.1.1.el8_3<br>
sles11-sp4-amd64      | 3.0.101-108.13.1<br>
sles12-sp2-amd64      | 4.4.74-92.38.1<br>
sles12-sp3-amd64      | 4.4.92-6.30.1<br>
sles12-sp4-amd64      | 4.12.14-95.3.1<br>
sles12-sp5-amd64      | 4.12.14-120.1<br>
sles15-sp0-amd64      | 4.12.14-25.25.1<br>
sles15-sp1-amd64      | 4.12.14-197.29<br>
sles15-sp2-amd64      | 5.3.18-22.2<br>
ubuntu-bionic-amd64   | ✗ 5.3.0-1034-aws; ✗ 5.3.0-1035-aws; <br>
5.4.0-1025-aws; 5.4.0-1028-aws; 5.4.0-1029-aws; 5.4.0-1030-aws; <br>
4.15.0-1007-aws<br>
ubuntu-bionic-amd64   | ✗ 5.3.0-1035-azure; ✗ 5.4.0-1023-azure; <br>
5.4.0-1025-azure; 5.4.0-1026-azure; 5.4.0-1031-azure; 5.4.0-1032-azure; <br>
4.15.0-1009-azure<br>
ubuntu-bionic-amd64   | 4.15.0-112-lowlatency<br>
ubuntu-bionic-amd64   | ✗ 4.15.0-118; ✗ 4.15.0-121; 4.15.0-122; <br>
4.15.0-123; 4.15.0-124; 4.15.0-126; 4.15.0-20<br>
ubuntu-focal-amd64    | ✗ 5.4.0-1022-aws; ✗ 5.4.0-1024-aws; <br>
5.4.0-1025-aws; 5.4.0-1028-aws; 5.4.0-1029-aws; 5.4.0-1030-aws; <br>
5.4.0-1009-aws<br>
ubuntu-focal-amd64    | ✗ 5.4.0-1022-azure; ✗ 5.4.0-1023-azure; <br>
5.4.0-1025-azure; 5.4.0-1026-azure; 5.4.0-1031-azure; 5.4.0-1032-azure; <br>
5.4.0-1010-azure<br>
ubuntu-focal-amd64    | ✗ 5.4.0-51; ✗ 5.4.0-52; 5.4.0-48; 5.4.0-53; <br>
5.4.0-54; 5.4.0-56; 5.4.0-26<br>
ubuntu-trusty-amd64   | 4.4.0-1022-aws<br>
ubuntu-trusty-amd64   | 3.13.0-129; 3.13.0-133; 3.13.0-139; 3.13.0-142; <br>
3.13.0-149<br>
ubuntu-xenial-amd64   | 4.4.0-1092-aws; 4.4.0-1098-aws; 4.4.0-1111-aws; <br>
4.4.0-1114-aws; 4.4.0-1117-aws<br>
ubuntu-xenial-amd64   | 4.13.0-1018-azure; 4.15.0-1036-azure; <br>
4.15.0-1040-azure<br>
ubuntu-xenial-amd64   | ✗ 4.4.0-190; 4.4.0-193; 4.4.0-194; 4.15.0-120; <br>
4.15.0-123; 4.4.0-197<br>
xenserver6.5-amd64    | 3.10.41-323<br>
xenserver7.1-amd64    | 4.4.27-572.565306<br>
xenserver7.2-amd64    | 4.4.52-2.1<br>
xenserver8.0-amd64    | 4.19.19-5.0.8<br>
<br>
<br>
Using one of these kernels will give you the smoothest experience when <br>
building DRBD. We actually pre-compute all compat patches for these <br>
kernels and put them in our release tarballs. This means that, if one of <br>
these kernels is detected, you will not need spatch at all and just need <br>
to apply a plain patch.<br>
<br>
For a lucky set of other kernels, we have made SPAAS (spatch as a <br>
service). This sends a &quot;fingerprint&quot; of your currently running kernel&#39;s <br>
capabilities to LINBIT, where we can then build a compat patch <br>
specifically for that kernel. This also works sometimes, but again, we <br>
cannot possibly guarantee that this works for any given kernel (not to <br>
mention test it so that it actually does the right thing).<br>
<br>
So, in conclusion, you have 2 options:<br>
<br>
a) Use one of the kernels we already support<br>
b) Figure out how to have DRBD build for your kernel yourself (it&#39;s not <br>
fun, take my word for it)<br>
c) Become a LINBIT customer and we will gladly do it for you :)<br>
<br>
<br>
Regarding this question:<br>
<br>
 &gt; PS: Coccinelle is only needed for backwards compatibility, right?  Is <br>
there a way to avoid its usage while using a recent enough kernel?<br>
<br>
Yes, *theoretically* DRBD should always build against the latest kernel <br>
release without needing compat patches. But as I already mentioned, <br>
there is a lot going on in the kernel, especially in the block layer, <br>
and since we support so many kernels it is a huge piece of work to patch <br>
back any larger modifications.<br>
<br>
So it is perfectly possible that we are lagging behind a few versions. I <br>
guess you can try finding the &quot;sweet spot&quot; where it works without <br>
patches. This should be somwhere around 5.9 at the moment.<br>
<br>
Hope this helps and isn&#39;t too disappointing :)<br>
<br>
--<br>
Christoph Böhmwalder<br>
LINBIT | Keeping the Digital World Running<br>
DRBD HA —  Disaster Recovery — Software defined Storage<br>
<br>
On 05.12.20 04:21, Pierre-Philipp Braun wrote:<br>
&gt; Hello<br>
&gt; <br>
&gt; I am having troubles building the v9 module although I tried with various releases and against many kernel versions.<br>
&gt; <br>
&gt; With branch drbd-9.0 and drbd-9.0.26-0rc2 against stock Ubuntu 5.8.0-31-generic<br>
&gt; <br>
&gt; In file included from /root/tp/drbd/drbd/drbd_main.c:19:<br>
&gt; ./include/linux/vermagic.h:6:2: error: #error &quot;This header can be included from kernel/module.c or *.mod.c only&quot;<br>
&gt;      6 | #error &quot;This header can be included from kernel/module.c or *.mod.c only&quot;<br>
&gt;        |  ^~~~~<br>
&gt; <br>
&gt; With release drbd-9.0.25-2 against stock Ubuntu 5.8.0-31-generic<br>
&gt; <br>
&gt; /root/tp/drbd-9.0.25-2/drbd/drbd_bitmap.c: In function &#39;bm_realloc_pages&#39;:<br>
&gt; /root/tp/drbd-9.0.25-2/drbd/drbd_bitmap.c:368:15: error: too many arguments to function &#39;__vmalloc&#39;<br>
&gt;    368 |   new_pages = __vmalloc(bytes,<br>
&gt;        |               ^~~~~~~~~<br>
&gt; <br>
&gt; With branch drbd-9.0 and drbd-9.0.26-0rc2 against vanilla+reiser4 linux-5.9.11<br>
&gt; <br>
&gt;    SPATCH   5470857a83aa446cd991bcef3cdf804a  5.9.11.xenreiser4<br>
&gt; make[3]: *** [Makefile:177: drbd-kernel-compat/cocci_cache/5470857a83aa446cd991bcef3cdf804a/compat.patch] Error 1<br>
&gt; make[2]: *** [/root/tp/drbd/drbd/Kbuild:135: /root/tp/drbd/drbd/drbd-kernel-compat/compat.patch] Error 2<br>
&gt; make[1]: *** [Makefile:1784: /root/tp/drbd/drbd] Error 2<br>
&gt; make: *** [Makefile:132: kbuild] Error 2<br>
&gt; <br>
&gt; With release drbd-9.0.25-2 against vanilla+reiser4 linux-5.9.11<br>
&gt; <br>
&gt;    GENPATCHNAMES   5.9.11.xenreiser4<br>
&gt; cat: drbd-kernel-compat/patches/claim_disk__no_link__no_claim.patch: No such file or directory<br>
&gt; make[3]: *** [Makefile:177: drbd-kernel-compat/cocci_cache/a89eb518bd21910d66ac3e0b5527f221/compat.patch] Error 1<br>
&gt; 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<br>
&gt; make[1]: *** [Makefile:1784: /root/tp/drbd-9.0.25-2/drbd] Error 2<br>
&gt; make: *** [Makefile:132: kbuild] Error 2<br>
&gt; <br>
&gt; What am I missing?  That&#39;s really hard to built and assistance would be much appreciated.<br>
&gt; <br>
&gt; PS: Coccinelle is only needed for backwards compatibility, right?  Is there a way to avoid its usage while using a recent enough kernel?<br>
&gt; <br>
&gt; Thanks<br>
&gt; <br>
_______________________________________________<br>
Star us on GITHUB: <a href="https://github.com/LINBIT" rel="noreferrer" target="_blank">https://github.com/LINBIT</a><br>
drbd-user mailing list<br>
<a href="mailto:drbd-user@lists.linbit.com" target="_blank">drbd-user@lists.linbit.com</a><br>
<a href="https://lists.linbit.com/mailman/listinfo/drbd-user" rel="noreferrer" target="_blank">https://lists.linbit.com/mailman/listinfo/drbd-user</a><br>
</blockquote></div>