<div dir="ltr">I tested building on 

5.8.0-31-generic (Ubuntu Focal) and I&#39;m getting the same error as you do, so I&#39;d assume that drbd cannot build against that kernel at the moment.<br>I have reverted back to 5.4.0-48-generic which seems to be ok.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 10 Dec 2020 at 05:59, Pierre-Philipp Braun &lt;<a href="mailto:pbraun@nethence.com">pbraun@nethence.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">Hey.  Here is some update on my attempts to build the v9 module on Ubuntu.  I managed to build it on Slackware Linux before, but for some reason all my attempts are failing on Ubuntu/focal.<br>
<br>
Ubuntu 20.04.1 LTS<br>
<br>
5.8.0-31-generic vs. 5.9.11.xenreiser4<br>
<br>
/usr/local/bin/spatch --version<br>
spatch version 1.0.8-00177-g28737419 compiled with OCaml version 4.08.1<br>
Flags passed to the configure script: [none]<br>
OCaml scripting support: yes<br>
Python scripting support: yes<br>
Syntax of regular expressions: Str<br>
<br>
---<br>
<br>
apt install drbd-dkms # <a href="https://launchpad.net/~linbit/+archive/ubuntu/linbit-drbd9-stack" rel="noreferrer" target="_blank">https://launchpad.net/~linbit/+archive/ubuntu/linbit-drbd9-stack</a><br>
cat /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/make.log<br>
<br>
[...]<br>
Successfully connected to SPAAS (&#39;d35a4b17210dab1336de2725b997f300e9acd297&#39;)<br>
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current<br>
                                 Dload  Upload   Total   Spent    Left  Speed<br>
100  4819    0     0    0  4819      0  70867 --:--:-- --:--:-- --:--:-- 69840<br>
  You can create a new .tgz including this pre-computed compat patch<br>
  by calling &quot;make unpatch ; echo drbd-9.0.25-1/drbd/drbd-kernel-compat/cocci_cache/19859231f3d13f02c91b7f06baf8e98c/compat.patch &gt;&gt;.filelist ; make tgz&quot;<br>
  PATCH<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_dax_pmem.o<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_debugfs.o<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.o<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_proc.o<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_sender.o<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_receiver.o<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_req.o<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_actlog.o<br>
/var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.c: In function &#39;bm_realloc_pages&#39;:<br>
/var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.c:368:15: error: too many arguments to function &#39;__vmalloc&#39;<br>
  368 |   new_pages = __vmalloc(bytes,<br>
      |               ^~~~~~~~~<br>
In file included from /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.c:16:<br>
./include/linux/vmalloc.h:111:14: note: declared here<br>
  111 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask);<br>
      |              ^~~~~~~~~<br>
make[2]: *** [scripts/Makefile.build:290: /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.o] Error 1<br>
make[2]: *** Waiting for unfinished jobs....<br>
make[1]: *** [Makefile:1780: /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd] Error 2<br>
make: *** [Makefile:132: kbuild] Error 2<br>
make: Leaving directory &#39;/var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd&#39;<br>
<br>
---<br>
<br>
same goes with my customized 5.9.11.xenreiser4 kernel<br>
<br>
Successfully connected to SPAAS (&#39;d35a4b17210dab1336de2725b997f300e9acd297&#39;)<br>
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current<br>
                                 Dload  Upload   Total   Spent    Left  Speed<br>
100  4819    0     0    0  4819      0  64253 --:--:-- --:--:-- --:--:-- 63407<br>
  You can create a new .tgz including this pre-computed compat patch<br>
  by calling &quot;make unpatch ; echo drbd-9.0.25-1/drbd/drbd-kernel-compat/cocci_cache/19859231f3d13f02c91b7f06baf8e98c/compat.patch &gt;&gt;.filelist ; make tgz&quot;<br>
  PATCH<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_dax_pmem.o<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_debugfs.o<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.o<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_proc.o<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_sender.o<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_receiver.o<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_req.o<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_actlog.o<br>
/var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.c: In function &#39;bm_realloc_pages&#39;:<br>
/var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.c:368:15: error: too many arguments to function &#39;__vmalloc&#39;<br>
  368 |   new_pages = __vmalloc(bytes,<br>
      |               ^~~~~~~~~<br>
In file included from /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.c:16:<br>
./include/linux/vmalloc.h:111:14: note: declared here<br>
  111 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask);<br>
      |              ^~~~~~~~~<br>
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/lru_cache.o<br>
make[2]: *** [scripts/Makefile.build:290: /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.o] Error 1<br>
make[2]: *** Waiting for unfinished jobs....<br>
make[1]: *** [Makefile:1780: /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd] Error 2<br>
make: *** [Makefile:132: kbuild] Error 2<br>
make: Leaving directory &#39;/var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd&#39;<br>
<br>
---<br>
<br>
cd drbd-9.0.26-0rc3/drbd/<br>
make # KDIR points to /usr/src/linux-headers-5.8.0-31-generic/<br>
<br>
  PATCH<br>
patching file ./drbd_int.h<br>
patching file drbd_main.c<br>
patching file drbd_nl.c<br>
patching file drbd_req.c<br>
patching file drbd_debugfs.c<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_dax_pmem.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_debugfs.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_bitmap.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_proc.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_sender.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_receiver.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_req.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_actlog.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/lru_cache.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.o<br>
In file included from /root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.c:19:<br>
./include/linux/vermagic.h:6:2: error: #error &quot;This header can be included from kernel/module.c or *.mod.c only&quot;<br>
    6 | #error &quot;This header can be included from kernel/module.c or *.mod.c only&quot;<br>
      |  ^~~~~<br>
make[2]: *** [scripts/Makefile.build:290: /root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.o] Error 1<br>
make[1]: *** [Makefile:1780: /root/tp/drbd-9.0.26-0rc3/drbd] Error 2<br>
make: *** [Makefile:132: kbuild] Error 2<br>
<br>
cd drbd/drbd/ # drbd-9.0<br>
make # KDIR points to /usr/src/linux-headers-5.8.0-31-generic/<br>
<br>
  PATCH<br>
patching file ./drbd_int.h<br>
patching file drbd_main.c<br>
patching file drbd_nl.c<br>
patching file drbd_req.c<br>
patching file drbd_debugfs.c<br>
  CC [M]  /root/tp/drbd/drbd/drbd_dax_pmem.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_debugfs.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_bitmap.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_proc.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_sender.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_receiver.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_req.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_actlog.o<br>
  CC [M]  /root/tp/drbd/drbd/lru_cache.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_main.o<br>
In file included from /root/tp/drbd/drbd/drbd_main.c:19:<br>
./include/linux/vermagic.h:6:2: error: #error &quot;This header can be included from kernel/module.c or *.mod.c only&quot;<br>
    6 | #error &quot;This header can be included from kernel/module.c or *.mod.c only&quot;<br>
      |  ^~~~~<br>
make[2]: *** [scripts/Makefile.build:290: /root/tp/drbd/drbd/drbd_main.o] Error 1<br>
make[1]: *** [Makefile:1780: /root/tp/drbd/drbd] Error 2<br>
make: *** [Makefile:132: kbuild] Error 2<br>
<br>
---<br>
<br>
cd drbd-9.0.26-0rc3/drbd/<br>
make KDIR=/usr/src/linux-5.9.11<br>
<br>
  PATCH<br>
patching file ./drbd_int.h<br>
patching file drbd_main.c<br>
patching file drbd_nl.c<br>
patching file drbd_req.c<br>
patching file drbd_debugfs.c<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_dax_pmem.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_debugfs.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_bitmap.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_proc.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_sender.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_receiver.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_req.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_actlog.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/lru_cache.o<br>
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.o<br>
In file included from /root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.c:19:<br>
./include/linux/vermagic.h:6:2: error: #error &quot;This header can be included from kernel/module.c or *.mod.c only&quot;<br>
    6 | #error &quot;This header can be included from kernel/module.c or *.mod.c only&quot;<br>
      |  ^~~~~<br>
/root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.c: In function &#39;drbd_create_device&#39;:<br>
/root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.c:3672:22: warning: passing argument 1 of &#39;blk_alloc_queue&#39; makes integer from pointer without a cast [-Wint-conversion]<br>
 3672 |  q = blk_alloc_queue(drbd_make_request, NUMA_NO_NODE);<br>
      |                      ^~~~~~~~~~~~~~~~~<br>
      |                      |<br>
      |                      blk_qc_t (*)(struct request_queue *, struct bio *) {aka unsigned int (*)(struct request_queue *, struct bio *)}<br>
In file included from ./include/linux/blk-cgroup.h:23,<br>
                 from ./include/linux/writeback.h:14,<br>
                 from ./include/linux/memcontrol.h:22,<br>
                 from ./include/net/sock.h:53,<br>
                 from /root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.c:24:<br>
./include/linux/blkdev.h:1195:23: note: expected &#39;int&#39; but argument is of type &#39;blk_qc_t (*)(struct request_queue *, struct bio *)&#39; {aka &#39;unsigned int (*)(struct request_queue *, struct bio *)&#39;}<br>
 1195 | struct request_queue *blk_alloc_queue(int node_id);<br>
      |                       ^~~~~~~~~~~~~~~<br>
/root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.c:3672:6: error: too many arguments to function &#39;blk_alloc_queue&#39;<br>
 3672 |  q = blk_alloc_queue(drbd_make_request, NUMA_NO_NODE);<br>
      |      ^~~~~~~~~~~~~~~<br>
In file included from ./include/linux/blk-cgroup.h:23,<br>
                 from ./include/linux/writeback.h:14,<br>
                 from ./include/linux/memcontrol.h:22,<br>
                 from ./include/net/sock.h:53,<br>
                 from /root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.c:24:<br>
./include/linux/blkdev.h:1195:23: note: declared here<br>
 1195 | struct request_queue *blk_alloc_queue(int node_id);<br>
      |                       ^~~~~~~~~~~~~~~<br>
make[2]: *** [scripts/Makefile.build:283: /root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.o] Error 1<br>
make[1]: *** [Makefile:1784: /root/tp/drbd-9.0.26-0rc3/drbd] Error 2<br>
make: *** [Makefile:132: kbuild] Error 2<br>
<br>
---<br>
<br>
cd drbd/drbd/ # drbd-9.0<br>
make KDIR=/usr/src/linux-5.9.11<br>
<br>
  PATCH<br>
patching file ./drbd_int.h<br>
patching file drbd_main.c<br>
patching file drbd_nl.c<br>
patching file drbd_req.c<br>
patching file drbd_debugfs.c<br>
  CC [M]  /root/tp/drbd/drbd/drbd_dax_pmem.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_debugfs.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_bitmap.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_proc.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_sender.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_receiver.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_req.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_actlog.o<br>
  CC [M]  /root/tp/drbd/drbd/lru_cache.o<br>
  CC [M]  /root/tp/drbd/drbd/drbd_main.o<br>
In file included from /root/tp/drbd/drbd/drbd_main.c:19:<br>
./include/linux/vermagic.h:6:2: error: #error &quot;This header can be included from kernel/module.c or *.mod.c only&quot;<br>
    6 | #error &quot;This header can be included from kernel/module.c or *.mod.c only&quot;<br>
      |  ^~~~~<br>
/root/tp/drbd/drbd/drbd_main.c: In function &#39;drbd_create_device&#39;:<br>
/root/tp/drbd/drbd/drbd_main.c:3672:22: warning: passing argument 1 of &#39;blk_alloc_queue&#39; makes integer from pointer without a cast [-Wint-conversion]<br>
 3672 |  q = blk_alloc_queue(drbd_make_request, NUMA_NO_NODE);<br>
      |                      ^~~~~~~~~~~~~~~~~<br>
      |                      |<br>
      |                      blk_qc_t (*)(struct request_queue *, struct bio *) {aka unsigned int (*)(struct request_queue *, struct bio *)}<br>
In file included from ./include/linux/blk-cgroup.h:23,<br>
                 from ./include/linux/writeback.h:14,<br>
                 from ./include/linux/memcontrol.h:22,<br>
                 from ./include/net/sock.h:53,<br>
                 from /root/tp/drbd/drbd/drbd_main.c:24:<br>
./include/linux/blkdev.h:1195:23: note: expected &#39;int&#39; but argument is of type &#39;blk_qc_t (*)(struct request_queue *, struct bio *)&#39; {aka &#39;unsigned int (*)(struct request_queue *, struct bio *)&#39;}<br>
 1195 | struct request_queue *blk_alloc_queue(int node_id);<br>
      |                       ^~~~~~~~~~~~~~~<br>
/root/tp/drbd/drbd/drbd_main.c:3672:6: error: too many arguments to function &#39;blk_alloc_queue&#39;<br>
 3672 |  q = blk_alloc_queue(drbd_make_request, NUMA_NO_NODE);<br>
      |      ^~~~~~~~~~~~~~~<br>
In file included from ./include/linux/blk-cgroup.h:23,<br>
                 from ./include/linux/writeback.h:14,<br>
                 from ./include/linux/memcontrol.h:22,<br>
                 from ./include/net/sock.h:53,<br>
                 from /root/tp/drbd/drbd/drbd_main.c:24:<br>
./include/linux/blkdev.h:1195:23: note: declared here<br>
 1195 | struct request_queue *blk_alloc_queue(int node_id);<br>
      |                       ^~~~~~~~~~~~~~~<br>
make[2]: *** [scripts/Makefile.build:283: /root/tp/drbd/drbd/drbd_main.o] Error 1<br>
make[1]: *** [Makefile:1784: /root/tp/drbd/drbd] Error 2<br>
make: *** [Makefile:132: kbuild] Error 2<br>
<br>
---<br>
<br>
What am I doing wrong?  Should I provide more information of some kind to help troubleshoot my builds?<br>
<br>
Thank you<br>
-- <br>
Pierre-Philipp<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>