Building DRBD v9 (troubleshooting)

Troubles on Ubuntu/focal

building branch drbd-9.0 and drbd 9.0.26-rc2 against vanilla+reiser4 linux-5.9.11

In file included from /root/tp/drbd-9.0.26-0rc2/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-0rc2/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);
      |      ^~~~~~~~~~~~~~~

building 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

building 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"
      |  ^~~~~

building 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,
      |               ^~~~~~~~~

building release drbd-9.0.26-0rc3 against 5.8.0-31-generic

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"
      |  ^~~~~

building branch 9 on Tue 8 dec 2020

/root/tp/drbd/drbd/drbd_receiver.c:671:38: error: 'P_DISCONNECT' undeclared (first use in this function); did you mean 'OC_DISCONNECT'?
  671 |  return send_command(connection, -1, P_DISCONNECT, CONTROL_STREAM);
      |                                      ^~~~~~~~~~~~
      |                                      OC_DISCONNECT

/root/tp/drbd/drbd/drbd_receiver.c:7990:3: error: 'P_DISCONNECT' undeclared here (not in a function); did you mean 'OC_DISCONNECT'?
 7990 |  [P_DISCONNECT]      = { 0, 0, receive_disconnect },
      |   ^~~~~~~~~~~~
      |   OC_DISCONNECT
/root/tp/drbd/drbd/drbd_receiver.c:7990:3: error: array index in initializer not of integer type

==> ALL SOLVED

Just use kernel.org 5.4 longterm and not 5.9 stable (or equivalent Ubuntu linux-* packages).

Resources

https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd

https://lists.linbit.com/pipermail/drbd-user/2020-December/thread.html