Mailing List Archive

building v9
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
--
Pierre-Philipp
_______________________________________________
Star us on GITHUB: https://github.com/LINBIT
drbd-user mailing list
drbd-user@lists.linbit.com
https://lists.linbit.com/mailman/listinfo/drbd-user
Re: building v9 [ In reply to ]
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
_______________________________________________
Star us on GITHUB: https://github.com/LINBIT
drbd-user mailing list
drbd-user@lists.linbit.com
https://lists.linbit.com/mailman/listinfo/drbd-user
Re: building v9 [ In reply to ]
I tested building on 5.8.0-31-generic (Ubuntu Focal) and I'm getting the
same error as you do, so I'd assume that drbd cannot build against that
kernel at the moment.
I have reverted back to 5.4.0-48-generic which seems to be ok.

On Thu, 10 Dec 2020 at 05:59, Pierre-Philipp Braun <pbraun@nethence.com>
wrote:

> 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
> _______________________________________________
> Star us on GITHUB: https://github.com/LINBIT
> drbd-user mailing list
> drbd-user@lists.linbit.com
> https://lists.linbit.com/mailman/listinfo/drbd-user
>
Re: building v9 [ In reply to ]
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
>
_______________________________________________
Star us on GITHUB: https://github.com/LINBIT
drbd-user mailing list
drbd-user@lists.linbit.com
https://lists.linbit.com/mailman/listinfo/drbd-user
Re: building v9 [ In reply to ]
Thanks Christoph for the very clear explanation, I think that it was a
piece which was missing for all of us!

B.R.
Yannis

On Thu, 10 Dec 2020 at 12:07, Christoph Böhmwalder <
christoph.boehmwalder@linbit.com> wrote:

> 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
> >
> _______________________________________________
> Star us on GITHUB: https://github.com/LINBIT
> drbd-user mailing list
> drbd-user@lists.linbit.com
> https://lists.linbit.com/mailman/listinfo/drbd-user
>
Re: building v9 [ In reply to ]
On 10/12/2020 12:07, Christoph Böhmwalder wrote:
> 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


Dear Christoph,

Thank you for this very informative message, and thank you to everyone
at Linbit for all of the hard work you guys do with drbd9.

I appreciate that there is a limit to the number of kernels you can
support, and the list contains a very good selection of distro kernels.

However I think there is a glaring omission which I'd like to ask you to
consider, which is the current Linux kernel (kernel.org) upstream LTS
stable release kernels. Since the LTS releases have multi-year support
life cycles they should not be too much of a burden to track. I suspect
you actually do track them but perhaps just are not included in the list
you emailed to the list. I would argue these are a much easier and all
round better choice than even the latest mainline kernel.org release,
most of which only have a few months of life before they become obsolete
if they do not become an LTS (Greg K only ever issues a few stable point
releases for non-LTS versions before declaring them dead).

I have many servers running drbd9 for many years now, have always built
against an upstream stable LTS release, and have never had a problem
building against them since you started using Coccinelle. So, I suspect,
as I say, you probably do track them anyhow. But just in case you don't
I want to ask you to seriously consider them. Pretty pleeease

warm regards,
Eddie
_______________________________________________
Star us on GITHUB: https://github.com/LINBIT
drbd-user mailing list
drbd-user@lists.linbit.com
https://lists.linbit.com/mailman/listinfo/drbd-user
Re: building v9 [ In reply to ]
> I tested building on 5.8.0-31-generic (Ubuntu Focal) and I'm getting the
> same error as you do, so I'd assume that drbd cannot build against that
> kernel at the moment.
> I have reverted back to 5.4.0-48-generic which seems to be ok.

Thank you! That's some kind of a workaround, but it worked for me too against 5.4.0-54-generic.

- drbd-dkms builds fine (drbd-9.0.25-1ppa1~focal1)
- drbd-9.0 builds fine
- drbd-9.0.26-0rc3 builds fine

So I grabbed latest longterm Linux release (instead of latest stable), re-built it with some custom config and I am good now. Against vanilla 5.4.82, everything's fine. As a side note, even the DKMS surprisingly builds, although this is a Slackware based kernel config.

- drbd-dkms builds fine (drbd-9.0.25-1ppa1~focal1)
- drbd-9.0 builds fine
- drbd-9.0.26-0rc3 builds fine

--
Pierre-Philipp
_______________________________________________
Star us on GITHUB: https://github.com/LINBIT
drbd-user mailing list
drbd-user@lists.linbit.com
https://lists.linbit.com/mailman/listinfo/drbd-user
Re: building v9 [ In reply to ]
> 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
[...]
> 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.

Thank you for the information. I like the theory)) But while I am now supposed to have a supported kernel, namely ubuntu-focal-amd64/5.4.0-54-generic, I still see the following.

UPD /root/tp/drbd-9.0.26-0rc3/drbd/compat.5.4.65.h
UPD /root/tp/drbd-9.0.26-0rc3/drbd/compat.h
GENPATCHNAMES 5.4.0-54-generic
SPATCH 0bd9b1bed5b937182f6ce6b7814719b2 5.4.0-54-generic
PATCH
patching file ./drbd_int.h
patching file drbd_bitmap.c
patching file drbd_sender.c
patching file drbd_receiver.c
patching file drbd_main.c
patching file drbd_nl.c
patching file drbd_req.c
patching file drbd_transport_tcp.c
patching file drbd_debugfs.c

and to check for sure, I renamed the spatch binary and got

UPD /root/tp/drbd/drbd/compat.5.4.65.h
UPD /root/tp/drbd/drbd/compat.h
./drbd-kernel-compat/gen_compat_patch.sh: line 12: spatch: command not found
./drbd-kernel-compat/gen_compat_patch.sh: line 45: hash: spatch: not found
INFO: not trying spatch-as-a-service because you are trying
to build DRBD from a git checkout. Please install a suitable
version of coccinelle (>1.0.8) or try building from a
release tarball.
ERROR: no suitable spatch found in $PATH. Install package 'coccinelle'!

> 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.

Hmm interesting. It would help to know how to find out about the exact and ideal version. It must be available somewhere, right? Having this version at the top of the table you've shared above (and even as number 1 supported kernel) would seem logical to me. And it would be great if this table could be shared publicly, maybe in drbd-9.0's README?

However, given my previous posts, drbd-9.0 does not build against 5.7, 5.8, nor stable 5.9 but against longterm 5.4.

Thank you!
--
Pierre-Philipp
_______________________________________________
Star us on GITHUB: https://github.com/LINBIT
drbd-user mailing list
drbd-user@lists.linbit.com
https://lists.linbit.com/mailman/listinfo/drbd-user
Re: building v9 [ In reply to ]
> Hmm interesting. It would help to know how to find out about the exact and ideal version. It must be available somewhere, right? Having this version at the top of the table you've shared above (and even as number 1 supported kernel) would seem logical to me. And it would be great if this table could be shared publicly, maybe in drbd-9.0's README?


My one month message old on this list. Not really related but see what
I've noticed...

Then a very fine man told me here that proxmox's packages are
available... (As proxmos is debian based, there are good for Debian 10 &
Ubuntu).

Hope this helps...

=============================================

I'm a Debian 10 user, which don't comes with a DRBD 9 package. So i did
it, through the well described process DRBD 9 comes with.

Particullary, I appreciate the trick to use a full docker container as a
command (spatch/inria coccinelle). And I understand why you are using
Coccinelle. The build complexity involved worth it.

Now my problem (if we should consider it is so) - stock new Debian 10
with original kernel 4.19 on a new high grade server (Xeon 16c, 64 Go,
NVMe 1To).

A first attempt with 9.0.25-1 6/11/20 :
- build ok
- packaging ok

But installing dkms_9.0.25-1_all.deb (kernel module) failed with a
non-explicit debian dpkg-buildpackage message (like... error : kernel
module not installed).

Second attempt with the drbd version closest to the kernel version :
9.0.16-1 25/10/18 (kernel 4.19 is dated 22/10/18)

All went fine.

It's not a problem for us to go in production with 9.0.16-1 (we will see
later / if / I am right to say so).

I wonder :

- how we could explain this behaviour and, maybe...
- how we could fix it

- why drbd 9 is not in debian 10 (and does not seem planned in debian
11, at least today)


Freundliche Grüße der Insel Oléron

=============================================

Build process - also in case other readers would like to test drbd 9
with debian 10


* Coccinelle

aptitude install apt-transport-https ca-certificates curl gnupg2
software-properties-common

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

add-apt-repository "deb [arch=amd64]
https://download.docker.com/linux/debian $(lsb_release -cs) stable"

aptitude update
apt-cache policy docker-ce
aptitude install docker-ce

systemctl status docker
docker pull szeder/coccinelle

touch /usr/local/bin/spatch
chmod +x s/usr/local/bin/spatch

#!/bin/bash
docker run -it --rm -v "$PWD:$PWD" -w "$PWD" szeder/coccinelle spatch "$@"


* Drbd - kernel module

aptitude install git build-essential fakeroot debhelper dkms docbook-xsl
help2man python-all python-dbus python-gobject xsltproc help2man
dh-systemd flex autoconf automake po4a clitest python-natsort
thin-provisioning-tools

mkdir /root/sow-drbd
cd /root/sow-drbd
git clone https://github.com/LINBIT/drbd.git
cd drbd

search match between kernel date and drbd date

git log --tags --simplify-by-decoration --pretty="format:%ai %d" | grep
2018

2018-10-25 11:15:45 +0200 (HEAD, tag: drbd-9.0.16-1)
2018-10-16 15:10:45 +0200 (tag: drbd-9.0.16-0rc1)
2018-08-14 13:13:50 +0200 (tag: drbd-9.0.15)
2018-05-01 00:13:42 +0200 (tag: drbd-9.0.14)
2018-04-17 10:33:08 +0200 (tag: drbd-9.0.13)
2018-04-06 14:33:03 +0200 (tag: drbd-9.0.13-0rc1)
2018-01-22 13:28:17 +0100 (tag: drbd-9.0.12)
2018-01-09 13:14:33 +0100 (tag: drbd-9.0.11)

git checkout drbd-9.0.16-1

Doc build workaround : Comment out all references to the documentation
in Makefile.in (search with the string "doc"). The --without-manual and
/ or --with-prebuiltman flags are not sufficient. Without this, the
compilation will be carried out perfectly but the build of the package
will fail.

make clean
make
dpkg-buildpackage -rfakeroot -b -uc



* Drbd - utils

cd /root/sow-drbd
git clone https://github.com/LINBIT/drbd-utils.git
cd drbd-utils

./autogen.sh

./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
--without-manual --with-prebuiltman --with-xen --with-distro=debian

make
dpkg-buildpackage -rfakeroot -b -uc

dpkg-buildpackage rebuild with theses configure options :

./configure
--prefix=/usr
--localstatedir=/var modifiable single-machine
data [PREFIX/var]
--sysconfdir=/etc read-only single-machine
data [PREFIX/etc]
--sbindir=/usr/sbin system admin executables
[EPREFIX/sbin]
--with-udev Enable udev integration
--with-xen Enable Xen integration
--with-pacemaker Enable Pacemaker integration
--with-rgmanager Enable Red Hat Cluster
Suite integration
--without-bashcompletion Enable programmable bash
completion
--with-systemdunitdir=/lib/systemd/system Directory for systemd
service files [Auto]
--with-initscripttype=both Type of init script to install
(sysv|systemd|both|none). [auto]
--with-prebuiltman Do not try to
(re)generate man pages


* Installing

packages created :

drbd-dkms_9.0.16-1_all.deb
drbd-module-source_9.0.16-1_all.deb
drbd-utils_9.13.1-1_amd64.deb
drbd-utils-dbgsym_9.13.1-1_amd64.deb
drbd8-utils_9.13.1-1_amd64.deb

Installing :

dpkg -i drbd-dkms_9.0.16-1_all.deb drbd-utils_9.13.1-1_amd64.deb

(Lecture de la base de données... 96165 fichiers et répertoires déjà
installés.)
Préparation du dépaquetage de drbd-dkms_9.0.16-1_all.deb ...
Dépaquetage de drbd-dkms (9.0.16-1) sur (9.0.16-1) ...
Sélection du paquet drbd-utils précédemment désélectionné.
Préparation du dépaquetage de drbd-utils_9.13.1-1_amd64.deb ...
Dépaquetage de drbd-utils (9.13.1-1) ...
Paramétrage de drbd-utils (9.13.1-1) ...
Paramétrage de drbd-dkms (9.0.16-1) ...
Loading new drbd-9.0.16-1 DKMS files...
Building for 4.19.0-12-amd64
Building initial module for 4.19.0-12-amd64
Done.

drbd.ko:
Running module version sanity check.
- Original module
- Installation
- Installing to /lib/modules/4.19.0-12-amd64/updates/dkms/

drbd_transport_tcp.ko:
Running module version sanity check.
- Original module
- Installation
- Installing to /lib/modules/4.19.0-12-amd64/updates/dkms/

depmod...

DKMS: install completed.
Traitement des actions différées (« triggers ») pour systemd
(241-7~deb10u4) ...


After reboot

modinfo drbd

filename: /lib/modules/4.19.0-12-amd64/updates/dkms/drbd.ko
alias: block-major-147-*
license: GPL
version: *9.0.16-1*
description: drbd - Distributed Replicated Block Device v9.0.16-1
author: Philipp Reisner <phil@linbit.com>, Lars Ellenberg
<lars@linbit.com>
srcversion: E3A2E554068CD055CD421FC
depends: libcrc32c
retpoline: Y
name: drbd
vermagic: 4.19.0-12-amd64 SMP mod_unload modversions
parm: enable_faults:int
parm: fault_rate:int
parm: fault_count:int
parm: fault_devs:int
parm: disable_sendpage:bool
parm: allow_oos:DONT USE! (bool)
parm: minor_count:Approximate number of drbd devices (1-255)
(uint)
parm: usermode_helper:string
parm: protocol_version_min:drbd_protocol_version


--
Stéphane Rivière
Ile d'Oléron - France
_______________________________________________
Star us on GITHUB: https://github.com/LINBIT
drbd-user mailing list
drbd-user@lists.linbit.com
https://lists.linbit.com/mailman/listinfo/drbd-user
Re: building v9 [ In reply to ]
Seems to be working fine here, but I'm using the tarballs from linbit web
page (download section) instead of using git, perhaps that makes a
difference ?

root@debian10:~# uname -r

4.19.0-13-amd64

DRBDADM_BUILDTAG=GIT-hash:\ fa9b9d3823b6e1792919e711fcf6164cac629290\
build\ by\ root@debian10\,\ 2020-12-12\ 17:53:20

DRBDADM_API_VERSION=2

DRBD_KERNEL_VERSION_CODE=0x090019

DRBD_KERNEL_VERSION=9.0.25

DRBDADM_VERSION_CODE=0x090f01

DRBDADM_VERSION=9.15.1

root@debian10:~# dkms status

drbd, 9.0.25-2, 4.19.0-13-amd64, x86_64: installed

root@debian10:~# ls -l /lib/modules/4.19.0-13-amd64/updates/dkms/

total 1244

-rw-r--r-- 1 root root 1226176 Dec 12 17:49 drbd.ko

-rw-r--r-- 1 root root 44248 Dec 12 17:49 drbd_transport_tcp.ko


> Now my problem (if we should consider it is so) - stock new Debian 10
> with original kernel 4.19 on a new high grade server (Xeon 16c, 64 Go,
> NVMe 1To).
>
> A first attempt with 9.0.25-1 6/11/20 :
> - build ok
> - packaging ok
>
> But installing dkms_9.0.25-1_all.deb (kernel module) failed with a
> non-explicit debian dpkg-buildpackage message (like... error : kernel
> module not installed).
>
Re: building v9 [ In reply to ]
Hi Gianni,

> Seems to be working fine here, but I'm using the tarballs from linbit
> web page (download section) instead of using git, perhaps that makes a
> difference ?

Yes. It seems. I choose the wrong way...

Now I use the Proxmox depot (lazy mode :)

Thanks for testing.

--
Stéphane Rivière
Ile d'Oléron - France
_______________________________________________
Star us on GITHUB: https://github.com/LINBIT
drbd-user mailing list
drbd-user@lists.linbit.com
https://lists.linbit.com/mailman/listinfo/drbd-user
Re: building v9 [ In reply to ]
> Hope this helps...

My building issues were solved already, once I reverted to longterm 5.4,
as I stated in my answer to Yannis in this very thread.

In my answer to Christoph, I was rather contradicting the fact that
Coccinelle could be avoided in case of supported kernels. And yes, I
also tried with the official drbd-9.0.26-0rc3 release. The only
difference is that it goes spatch-as-a-service.

Then about seeking for the ideal kernel version and mentioning it
somewhere, as well as sharing supported kernels in a more memorable
place than on the mailing-list, that was merely an attempt to push for
more transparency and letting the community contribute more. I didn't
mean that I was still stuck with the build.

Thanks anyways :-)
_______________________________________________
Star us on GITHUB: https://github.com/LINBIT
drbd-user mailing list
drbd-user@lists.linbit.com
https://lists.linbit.com/mailman/listinfo/drbd-user