[DRBD-user] DRBD fails to compile on RHEL6 based kernels like OpenVZ 2.6.32

Stefan Priebe - Profihost AG s.priebe at profihost.ag
Mon Jun 6 10:24:14 CEST 2011

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


Hi,

i'm trying to compile DRBD on a RHEL6 based kernel like the one from 
OpenVZ (2.6.32).

Sadly every build failes with:
   CC [M]  /usr/src/drbd/drbd-8.3.11rc1/drbd/drbd_receiver.o
/usr/src/drbd/drbd-8.3.11rc1/drbd/drbd_receiver.c: In function 
'drbd_submit_ee':
/usr/src/drbd/drbd-8.3.11rc1/drbd/drbd_receiver.c:1282: error: 
'REQ_UNPLUG' undeclared (first use in this function)
/usr/src/drbd/drbd-8.3.11rc1/drbd/drbd_receiver.c:1282: error: (Each 
undeclared identifier is reported only once
/usr/src/drbd/drbd-8.3.11rc1/drbd/drbd_receiver.c:1282: error: for each 
function it appears in.)
/usr/src/drbd/drbd-8.3.11rc1/drbd/drbd_receiver.c: In function 
'wire_flags_to_bio':
/usr/src/drbd/drbd-8.3.11rc1/drbd/drbd_receiver.c:1860: error: 
'REQ_UNPLUG' undeclared (first use in this function)
make[3]: *** [/usr/src/drbd/drbd-8.3.11rc1/drbd/drbd_receiver.o] Error 1
make[2]: *** [_module_/usr/src/drbd/drbd-8.3.11rc1/drbd] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-2.6.32-015.1-openvz-amd'
make[1]: *** [kbuild] Error 2
make[1]: Leaving directory `/usr/src/drbd/drbd-8.3.11rc1/drbd'
make: *** [module] Error 2

I then applied the following patch which results in a loadable module

diff -upr linux-2.6.32.patched.orig/drivers/block/drbd/drbd_wrappers.h 
linux-2.6.32/drivers/block/drbd/drbd_wrappers.h
--- linux-2.6.32.patched.orig/drivers/block/drbd/drbd_wrappers.h 
2011-05-31 14:41:08.319923899 +0200
+++ linux-2.6.32/drivers/block/drbd/drbd_wrappers.h	2011-05-31 
14:28:35.745728899 +0200
@@ -860,14 +860,20 @@ enum {
  #define DRBD_REQ_UNPLUG		(1UL << BIO_RW_SYNC)
  #elif defined(REQ_SYNC)		/* introduced in 2.6.36 */
  #define DRBD_REQ_SYNC		REQ_SYNC
+
+/* RHEL 6 seems to has backported REQ_SYNC but not REQ_UNPLUG */
+#ifndef REQ_UNPLUG
+#define DRBD_REQ_UNPLUG         (1UL << BIO_RW_UNPLUG)
+#else
  #define DRBD_REQ_UNPLUG		REQ_UNPLUG
+#endif
+
  #else
  /* cannot test on defined(BIO_RW_SYNCIO), it may be an enum */
  #define DRBD_REQ_SYNC		(1UL << BIO_RW_SYNCIO)
  #define DRBD_REQ_UNPLUG		(1UL << BIO_RW_UNPLUG)
  #endif

-
  #ifdef REQ_FLUSH	/* introduced in 2.6.36, now equivalent to bi_rw */
  #define DRBD_REQ_FLUSH		REQ_FLUSH
  #define DRBD_REQ_FUA		REQ_FUA


But when you're trying to write to the mounted drbd disk then you got:
[   59.754706] JBD2: I/O error detected when updating journal superblock 
for drbd0-8.
[   59.754948] Aborting journal on device drbd0-8.
[   59.755004] JBD2: I/O error detected when updating journal superblock 
for drbd0-8.
[   68.648409] EXT4-fs error (device drbd0): ext4_journal_start_sb: 
Detected aborted journal
[   68.648601] EXT4-fs (drbd0): Remounting filesystem read-only

-- 
Regards
   Stefan



More information about the drbd-user mailing list