[DRBD-user] DRBD9 compiling/compat issues on kernel 5.9.13

e-m e-m at mailbox.org
Wed Dec 9 15:58:06 CET 2020


Hi,

I am on the "drbd-9.0" branch.
First problem is that some of the compat tests are failing. My 
understanding is that there should not be any patch needed because I am 
using the latest kernel (5.9) which 9.0.26-0rc3 is based on.
But when doing a "make", the following patches are getting applied:

//////////

   UPD     /[...]//drbd/drbd/compat.5.9.13-arch1.h
   UPD     /[...]//drbd/drbd/compat.h
   GENPATCHNAMES   5.9.13-arch1-1
   SPATCH   5470857a83aa446cd991bcef3cdf804a  5.9.13-arch1-1
   PATCH
patching file ./drbd_int.h
patching file drbd_req.c
patching file drbd_nl.c
patching file drbd_main.c
patching file drbd_debugfs.c
//////////

After that, the following error appears:

//////////
   CC [M]  /[...]/drbd/drbd/drbd_main.o
In file included from /[...]/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"
       |  ^~~~~
//////////


I went back a step to see why the patches are getting applied. There 
seems to be an issue with drbd-kernel-compat/tests/have_submit_bio.c 
(maybe others too, I only checked this).
This compat check fails because it is using "struct 
block_device_operations" and only includes <linux/blk_types.h> but the 
struct is defined in <linux/blkdev.h>.
So I modified the Kbuild to do not apply any patches.
Now the build fails with:

//////////

/[...]/drbd/drbd/drbd_req.c: In function 'drbd_submit_bio':
/[...]/drbd/drbd/drbd_req.c:2199:54: error: 'q' undeclared (first use in 
this function); did you mean 'rq'?
  2199 |  struct drbd_device *device = (struct drbd_device *) q->queuedata;
//////////

q is not defined in that function but this is the case on 9.0.26-0rc1 
too. It seems to me that such a simple mistake would not make it to the 
next rc... so I guess I am missing something?


My environment:
- OS: Arch Linux
- Kernel: 5.9.13 (5.9.13-arch1-1)


Thanks for reading.



More information about the drbd-user mailing list