[DRBD-user] building v9

Pierre-Philipp Braun pbraun at nethence.com
Thu Dec 10 06:59:22 CET 2020


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.

Ubuntu 20.04.1 LTS

5.8.0-31-generic vs. 5.9.11.xenreiser4

/usr/local/bin/spatch --version
spatch version 1.0.8-00177-g28737419 compiled with OCaml version 4.08.1
Flags passed to the configure script: [none]
OCaml scripting support: yes
Python scripting support: yes
Syntax of regular expressions: Str

---

apt install drbd-dkms # https://launchpad.net/~linbit/+archive/ubuntu/linbit-drbd9-stack
cat /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/make.log

[...]
Successfully connected to SPAAS ('d35a4b17210dab1336de2725b997f300e9acd297')
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4819    0     0    0  4819      0  70867 --:--:-- --:--:-- --:--:-- 69840
  You can create a new .tgz including this pre-computed compat patch
  by calling "make unpatch ; echo drbd-9.0.25-1/drbd/drbd-kernel-compat/cocci_cache/19859231f3d13f02c91b7f06baf8e98c/compat.patch >>.filelist ; make tgz"
  PATCH
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_dax_pmem.o
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_debugfs.o
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.o
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_proc.o
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_sender.o
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_receiver.o
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_req.o
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_actlog.o
/var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.c: In function 'bm_realloc_pages':
/var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.c:368:15: error: too many arguments to function '__vmalloc'
  368 |   new_pages = __vmalloc(bytes,
      |               ^~~~~~~~~
In file included from /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.c:16:
./include/linux/vmalloc.h:111:14: note: declared here
  111 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask);
      |              ^~~~~~~~~
make[2]: *** [scripts/Makefile.build:290: /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1780: /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd] Error 2
make: *** [Makefile:132: kbuild] Error 2
make: Leaving directory '/var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd'

---

same goes with my customized 5.9.11.xenreiser4 kernel

Successfully connected to SPAAS ('d35a4b17210dab1336de2725b997f300e9acd297')
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4819    0     0    0  4819      0  64253 --:--:-- --:--:-- --:--:-- 63407
  You can create a new .tgz including this pre-computed compat patch
  by calling "make unpatch ; echo drbd-9.0.25-1/drbd/drbd-kernel-compat/cocci_cache/19859231f3d13f02c91b7f06baf8e98c/compat.patch >>.filelist ; make tgz"
  PATCH
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_dax_pmem.o
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_debugfs.o
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.o
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_proc.o
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_sender.o
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_receiver.o
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_req.o
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_actlog.o
/var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.c: In function 'bm_realloc_pages':
/var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.c:368:15: error: too many arguments to function '__vmalloc'
  368 |   new_pages = __vmalloc(bytes,
      |               ^~~~~~~~~
In file included from /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.c:16:
./include/linux/vmalloc.h:111:14: note: declared here
  111 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask);
      |              ^~~~~~~~~
  CC [M]  /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/lru_cache.o
make[2]: *** [scripts/Makefile.build:290: /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd/drbd_bitmap.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1780: /var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd] Error 2
make: *** [Makefile:132: kbuild] Error 2
make: Leaving directory '/var/lib/dkms/drbd/9.0.25-1ppa1~focal1/build/src/drbd'

---

cd drbd-9.0.26-0rc3/drbd/
make # KDIR points to /usr/src/linux-headers-5.8.0-31-generic/

  PATCH
patching file ./drbd_int.h
patching file drbd_main.c
patching file drbd_nl.c
patching file drbd_req.c
patching file drbd_debugfs.c
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_dax_pmem.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_debugfs.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_bitmap.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_proc.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_sender.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_receiver.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_req.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_actlog.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/lru_cache.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.o
In file included from /root/tp/drbd-9.0.26-0rc3/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"
      |  ^~~~~
make[2]: *** [scripts/Makefile.build:290: /root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.o] Error 1
make[1]: *** [Makefile:1780: /root/tp/drbd-9.0.26-0rc3/drbd] Error 2
make: *** [Makefile:132: kbuild] Error 2

cd drbd/drbd/ # drbd-9.0
make # KDIR points to /usr/src/linux-headers-5.8.0-31-generic/

  PATCH
patching file ./drbd_int.h
patching file drbd_main.c
patching file drbd_nl.c
patching file drbd_req.c
patching file drbd_debugfs.c
  CC [M]  /root/tp/drbd/drbd/drbd_dax_pmem.o
  CC [M]  /root/tp/drbd/drbd/drbd_debugfs.o
  CC [M]  /root/tp/drbd/drbd/drbd_bitmap.o
  CC [M]  /root/tp/drbd/drbd/drbd_proc.o
  CC [M]  /root/tp/drbd/drbd/drbd_sender.o
  CC [M]  /root/tp/drbd/drbd/drbd_receiver.o
  CC [M]  /root/tp/drbd/drbd/drbd_req.o
  CC [M]  /root/tp/drbd/drbd/drbd_actlog.o
  CC [M]  /root/tp/drbd/drbd/lru_cache.o
  CC [M]  /root/tp/drbd/drbd/drbd_main.o
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"
      |  ^~~~~
make[2]: *** [scripts/Makefile.build:290: /root/tp/drbd/drbd/drbd_main.o] Error 1
make[1]: *** [Makefile:1780: /root/tp/drbd/drbd] Error 2
make: *** [Makefile:132: kbuild] Error 2

---

cd drbd-9.0.26-0rc3/drbd/
make KDIR=/usr/src/linux-5.9.11

  PATCH
patching file ./drbd_int.h
patching file drbd_main.c
patching file drbd_nl.c
patching file drbd_req.c
patching file drbd_debugfs.c
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_dax_pmem.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_debugfs.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_bitmap.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_proc.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_sender.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_receiver.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_req.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_actlog.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/lru_cache.o
  CC [M]  /root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.o
In file included from /root/tp/drbd-9.0.26-0rc3/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"
      |  ^~~~~
/root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.c: In function 'drbd_create_device':
/root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.c:3672:22: warning: passing argument 1 of 'blk_alloc_queue' makes integer from pointer without a cast [-Wint-conversion]
 3672 |  q = blk_alloc_queue(drbd_make_request, NUMA_NO_NODE);
      |                      ^~~~~~~~~~~~~~~~~
      |                      |
      |                      blk_qc_t (*)(struct request_queue *, struct bio *) {aka unsigned int (*)(struct request_queue *, struct bio *)}
In file included from ./include/linux/blk-cgroup.h:23,
                 from ./include/linux/writeback.h:14,
                 from ./include/linux/memcontrol.h:22,
                 from ./include/net/sock.h:53,
                 from /root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.c:24:
./include/linux/blkdev.h:1195:23: note: expected 'int' but argument is of type 'blk_qc_t (*)(struct request_queue *, struct bio *)' {aka 'unsigned int (*)(struct request_queue *, struct bio *)'}
 1195 | struct request_queue *blk_alloc_queue(int node_id);
      |                       ^~~~~~~~~~~~~~~
/root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.c:3672:6: error: too many arguments to function 'blk_alloc_queue'
 3672 |  q = blk_alloc_queue(drbd_make_request, NUMA_NO_NODE);
      |      ^~~~~~~~~~~~~~~
In file included from ./include/linux/blk-cgroup.h:23,
                 from ./include/linux/writeback.h:14,
                 from ./include/linux/memcontrol.h:22,
                 from ./include/net/sock.h:53,
                 from /root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.c:24:
./include/linux/blkdev.h:1195:23: note: declared here
 1195 | struct request_queue *blk_alloc_queue(int node_id);
      |                       ^~~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:283: /root/tp/drbd-9.0.26-0rc3/drbd/drbd_main.o] Error 1
make[1]: *** [Makefile:1784: /root/tp/drbd-9.0.26-0rc3/drbd] Error 2
make: *** [Makefile:132: kbuild] Error 2

---

cd drbd/drbd/ # drbd-9.0
make KDIR=/usr/src/linux-5.9.11

  PATCH
patching file ./drbd_int.h
patching file drbd_main.c
patching file drbd_nl.c
patching file drbd_req.c
patching file drbd_debugfs.c
  CC [M]  /root/tp/drbd/drbd/drbd_dax_pmem.o
  CC [M]  /root/tp/drbd/drbd/drbd_debugfs.o
  CC [M]  /root/tp/drbd/drbd/drbd_bitmap.o
  CC [M]  /root/tp/drbd/drbd/drbd_proc.o
  CC [M]  /root/tp/drbd/drbd/drbd_sender.o
  CC [M]  /root/tp/drbd/drbd/drbd_receiver.o
  CC [M]  /root/tp/drbd/drbd/drbd_req.o
  CC [M]  /root/tp/drbd/drbd/drbd_actlog.o
  CC [M]  /root/tp/drbd/drbd/lru_cache.o
  CC [M]  /root/tp/drbd/drbd/drbd_main.o
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"
      |  ^~~~~
/root/tp/drbd/drbd/drbd_main.c: In function 'drbd_create_device':
/root/tp/drbd/drbd/drbd_main.c:3672:22: warning: passing argument 1 of 'blk_alloc_queue' makes integer from pointer without a cast [-Wint-conversion]
 3672 |  q = blk_alloc_queue(drbd_make_request, NUMA_NO_NODE);
      |                      ^~~~~~~~~~~~~~~~~
      |                      |
      |                      blk_qc_t (*)(struct request_queue *, struct bio *) {aka unsigned int (*)(struct request_queue *, struct bio *)}
In file included from ./include/linux/blk-cgroup.h:23,
                 from ./include/linux/writeback.h:14,
                 from ./include/linux/memcontrol.h:22,
                 from ./include/net/sock.h:53,
                 from /root/tp/drbd/drbd/drbd_main.c:24:
./include/linux/blkdev.h:1195:23: note: expected 'int' but argument is of type 'blk_qc_t (*)(struct request_queue *, struct bio *)' {aka 'unsigned int (*)(struct request_queue *, struct bio *)'}
 1195 | struct request_queue *blk_alloc_queue(int node_id);
      |                       ^~~~~~~~~~~~~~~
/root/tp/drbd/drbd/drbd_main.c:3672:6: error: too many arguments to function 'blk_alloc_queue'
 3672 |  q = blk_alloc_queue(drbd_make_request, NUMA_NO_NODE);
      |      ^~~~~~~~~~~~~~~
In file included from ./include/linux/blk-cgroup.h:23,
                 from ./include/linux/writeback.h:14,
                 from ./include/linux/memcontrol.h:22,
                 from ./include/net/sock.h:53,
                 from /root/tp/drbd/drbd/drbd_main.c:24:
./include/linux/blkdev.h:1195:23: note: declared here
 1195 | struct request_queue *blk_alloc_queue(int node_id);
      |                       ^~~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:283: /root/tp/drbd/drbd/drbd_main.o] Error 1
make[1]: *** [Makefile:1784: /root/tp/drbd/drbd] Error 2
make: *** [Makefile:132: kbuild] Error 2

---

What am I doing wrong?  Should I provide more information of some kind to help troubleshoot my builds?

Thank you
-- 
Pierre-Philipp


More information about the drbd-user mailing list