[DRBD-user] building drbd 8.3.9 against upstream kernel

Or Gerlitz ogerlitz at Voltaire.com
Sun Nov 7 11:42:15 CET 2010

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


Attempting to build drbd 8.3.9 against 2.6.36 I have run into few build errors, I have managed to get
drbd_receiver.c and drbd_main.c to build fine with the below patch,

> make -C /lib/modules/2.6.36/source  O=/lib/modules/2.6.36/build SUBDIRS=/home/ogerlitz/linux/drbd/drbd-8.3.9/drbd  modules
>   CC [M]  /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_buildtag.o
>   CC [M]  /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_bitmap.o
>   CC [M]  /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_proc.o
>   CC [M]  /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_worker.o
>   CC [M]  /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_receiver.o
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_receiver.c: In function ‘write_flags_to_bio’:
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_receiver.c:1818: error: ‘REQ_BCOMP_SYNC’ undeclared (first use in this function)
[...]
>  CC [M]  /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_main.o
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_main.c: In function ‘bio_flags_to_wire’:
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_main.c:2647: error: ‘DP_BCOMP_UNPLUG’ undeclared (first use in this function)

but then drbd_tracing put some more serious challenges, so what would be the best way to proceed. 

I saw that the drbd driver release version of 2.6.37-rc1 is 8.3.9rc2 so I assume anything below 2.6.38 
using the non-upstream drbd bits should be useful to get the latest cut of drbd development/releases.

Or.

>  CC [M]  /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.o
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c: In function ‘probe_drbd_bio’:
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:388: error: ‘BIO_RW_BARRIER’ undeclared (first use in this function)
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:388: error: (Each undeclared identifier is reported only once
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:388: error: for each function it appears in.)
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:392: error: ‘BIO_RW_SYNCIO’ undeclared (first use in this function)
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:392: error: ‘BIO_RW_UNPLUG’ undeclared (first use in this function)
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c: In function ‘drbd_trace_init’:
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:683: warning: passing argument 1 of ‘register_trace_drbd_unplug’ from incompatible pointer type
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:683: error: too few arguments to function ‘register_trace_drbd_unplug’
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:687: warning: passing argument 1 of ‘register_trace_drbd_uuid’ from incompatible pointer type
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:687: error: too few arguments to function ‘register_trace_drbd_uuid’
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:691: warning: passing argument 1 of ‘register_trace_drbd_ee’ from incompatible pointer type
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:691: error: too few arguments to function ‘register_trace_drbd_ee’
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:695: warning: passing argument 1 of ‘register_trace_drbd_packet’ from incompatible pointer type
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:695: error: too few arguments to function ‘register_trace_drbd_packet’
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:699: warning: passing argument 1 of ‘register_trace_drbd_md_io’ from incompatible pointer type
> /home/ogerlitz/linux/drbd/drbd-8.3.9/drbd/drbd_tracing.c:699: error: too few arguments to function ‘register_trace_drbd_md_io’



Index: drbd/drbd_receiver.c
===================================================================
--- drbd.orig/drbd_receiver.c
+++ drbd/drbd_receiver.c
@@ -47,6 +47,7 @@
 #include "drbd_tracing.h"
 #include "drbd_req.h"
 #include "drbd_vli.h"
+#include "drbd_wrappers.h"
 #ifdef HAVE_LINUX_SCATTERLIST_H
 /* 2.6.11 (suse 9.3, fc4) does not include requisites
  * from linux/scatterlist.h :( */
Index: drbd/drbd_wrappers.h
===================================================================
--- drbd.orig/drbd_wrappers.h
+++ drbd/drbd_wrappers.h
@@ -778,6 +778,11 @@ typedef _Bool                   bool;
 #endif
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
+#define REQ_BCOMP_SYNC  (0)
+//#define DP_BCOMP_UNPLUG (0)
+#endif
+
 #ifndef REQ_FLUSH
 #define REQ_FLUSH       (0)
 #endif
Index: drbd/drbd_main.c
===================================================================
--- drbd.orig/drbd_main.c
+++ drbd/drbd_main.c
@@ -56,6 +56,7 @@
 #include "drbd_tracing.h"
 #include "drbd_req.h" /* only for _req_mod in tl_release and tl_clear */
 #include "drbd_vli.h"
+#include "drbd_wrappers.h"
 
 #ifdef HAVE_LINUX_BYTEORDER_SWABB_H
 #include <linux/byteorder/swabb.h>



More information about the drbd-user mailing list