Skip to contentSkip to conversation

Compatibility with 2.6.30 and current git

Drbd-dev Ante Karamatić 2 participants 3 messages Jun 19, 2009 DRBD driver

lore
Share & tools
lore
#0 lore raw

Hi

I've mentioned this during Ubuntu 8.10 time frame, but nothing much has changed since then.

Looking at linux/drbd.h, there's this part:

#ifndef CN_IDX_DRBD

# define CN_IDX_DRBD                    0x4
/* Ubuntu "intrepid ibex" release defined CN_IDX_DRBD as 0x6 */
#endif

Ubuntu defined CN_IDX_DRBD as 0x6 cause 0x4 was taken by vesa framebuffer device. Linux kernels 2.6.30 and latest git has both 0x4 and 0x6 taken by other modules (include/linux/connector.h):

#define CN_IDX_V86D 0x4

#define CN_DST_IDX 0x6

These IDs should be unique (hence the name 'Process Events connector unique ids'). If you want 2.6.30 compatibility (at least), change it to 0x7. That one is free. But keep an eye on it for 2.6.31. So, something like this:

#ifndef CN_IDX_DRBD

# define CN_IDX_DRBD                    0x7
#endif

In current state, if vesa frame buffer module is loaded, drbd won't work. Module will load, but userspace tools won't be able to connect to it - they'll be connecting to frame buffer :)

Take care...

maintainer
#1 lore raw
Quoted 16 lines · Ante Karamatić

Hi

I've mentioned this during Ubuntu 8.10 time frame, but nothing much has changed since then.

Looking at linux/drbd.h, there's this part:

#ifndef CN_IDX_DRBD

# define CN_IDX_DRBD                    0x4
/* Ubuntu "intrepid ibex" release defined CN_IDX_DRBD as 0x6 */
#endif

Ubuntu defined CN_IDX_DRBD as 0x6 cause 0x4 was taken by vesa framebuffer device. Linux kernels 2.6.30 and latest git has both 0x4 and 0x6 taken by other modules (include/linux/connector.h):

Quoted 8 lines

#define CN_IDX_V86D 0x4

#define CN_DST_IDX 0x6

These IDs should be unique (hence the name 'Process Events connector unique ids'). If you want 2.6.30 compatibility (at least), change it to 0x7. That one is free. But keep an eye on it for 2.6.31. So, something like this:

NOnono.
the userland needs to be backwards compatible,
and must be able to find the connector index used by the kernel module.

there is now a module parameter cn_idx,
which shows up in /sys/modules/drbd/parameters/cn_idx, so the userland finds it.
you can set it to whatever you want.
if not set, it defaults to what old drbd userland expected. and when drbd tries to register that connector index, and it fails, it will simply add 6977, and try again. it tries 10 times.

Quoted 3 lines

In current state, if vesa frame buffer module is loaded, drbd won't work. Module will load, but userspace tools won't be able to connect to it - they'll be connecting to frame buffer :)

get your facts straight.

Signature · 5 lines
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
#2 lore raw
Quoted 4 lines · Lars Ellenberg

there is now a module parameter cn_idx,
which shows up in /sys/modules/drbd/parameters/cn_idx, so the userland finds it.
you can set it to whatever you want.

Ah, sorry, I wasn't aware of that. Thanks for clarification.