Linux Kernel 6.1.0.27 Driver 9.2.11

Ist not possible to build DRBD-Driver 9.2.11 with Kernel 6.1.0.27

In file included from /tmp/drbd_kernelmodul/drbd-9.2.11/drbd/drbd-headers/linux/genl_magic_func.h:292,
                 from /tmp/drbd_kernelmodul/drbd-9.2.11/drbd/drbd_nl.c:90:
/tmp/drbd_kernelmodul/drbd-9.2.11/drbd/drbd-headers/linux/drbd_genl.h: In function ‘drbd_genl_multicast_events’:
/tmp/drbd_kernelmodul/drbd-9.2.11/drbd/drbd-headers/linux/genl_magic_func-genl_register_family_with_ops_groups.h:21:16: error: too many arguments to function ‘genlmsg_multicast_allns’
   21 |         return genlmsg_multicast_allns(&ZZZ_genl_family, skb, 0,        \
      |                ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/drbd_kernelmodul/drbd-9.2.11/drbd/drbd-headers/linux/drbd_genl.h:385:1: note: in expansion of macro ‘GENL_mc_group’
  385 | GENL_mc_group(events)
      | ^~~~~~~~~~~~~
In file included from /tmp/drbd_kernelmodul/drbd-9.2.11/drbd/drbd-headers/linux/genl_magic_struct.h:20,
                 from /tmp/drbd_kernelmodul/drbd-9.2.11/drbd/drbd-headers/linux/drbd_genl_api.h:40,
                 from /tmp/drbd_kernelmodul/drbd-9.2.11/drbd/drbd_int.h:34,
                 from /tmp/drbd_kernelmodul/drbd-9.2.11/drbd/drbd_nl.c:25:
/usr/src/linux-headers-6.1.0-27-common/include/net/genetlink.h:361:5: note: declared here
  361 | int genlmsg_multicast_allns(const struct genl_family *family,
      |     ^~~~~~~~~~~~~~~~~~~~~~~


and some other…

with kernel 6.1.0.26 build works

Seems like this change was backported to 6.1
genetlink: hold RCU in genlmsg_mcast() · torvalds/linux@56440d7

I’m getting the same error when building the DKMS module for DRBD drbd-9.1.18

  CC [M]  /var/lib/dkms/drbd/9.1.18-1/build/src/drbd/drbd_nl.o
In file included from /var/lib/dkms/drbd/9.1.18-1/build/src/drbd/drbd-headers/linux/genl_magic_func.h:292,
                 from /var/lib/dkms/drbd/9.1.18-1/build/src/drbd/drbd_nl.c:89:
/var/lib/dkms/drbd/9.1.18-1/build/src/drbd/drbd-headers/linux/drbd_genl.h: In function 'drbd_genl_multicast_events':
/var/lib/dkms/drbd/9.1.18-1/build/src/drbd/drbd-headers/linux/genl_magic_func-genl_register_family_with_ops_groups.h:21:16: error: too many arguments to function 'genlmsg_multicast_allns'
   21 |         return genlmsg_multicast_allns(&ZZZ_genl_family, skb, 0,        \
      |                ^~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/drbd/9.1.18-1/build/src/drbd/drbd-headers/linux/drbd_genl.h:384:1: note: in expansion of macro 'GENL_mc_group'
  384 | GENL_mc_group(events)
      | ^~~~~~~~~~~~~
In file included from /var/lib/dkms/drbd/9.1.18-1/build/src/drbd/drbd-headers/linux/genl_magic_struct.h:20,
                 from /var/lib/dkms/drbd/9.1.18-1/build/src/drbd/drbd-headers/linux/drbd_genl_api.h:40,
                 from /var/lib/dkms/drbd/9.1.18-1/build/src/drbd/drbd_int.h:34,
                 from /var/lib/dkms/drbd/9.1.18-1/build/src/drbd/drbd_nl.c:25:
/usr/src/linux-headers-6.1.0-27-common/include/net/genetlink.h:361:5: note: declared here
  361 | int genlmsg_multicast_allns(const struct genl_family *family,
      |     ^~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [/usr/src/linux-headers-6.1.0-27-common/scripts/Makefile.build:255: /var/lib/dkms/drbd/9.1.18-1/build/src/drbd/drbd_nl.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.1.0-27-common/Makefile:2034: /var/lib/dkms/drbd/9.1.18-1/build/src/drbd] Error 2
make: *** [Makefile:134: kbuild] Error 2
make: Leaving directory '/var/lib/dkms/drbd/9.1.18-1/build/src/drbd'

Same error building 9.2.11 on longterm kernel 6.6.60
Removal of argument to genlmsg_multicast_allns since kernel 6.6.59:

grep -r genlmsg_multicast_allns *
linux-6.6.58/include/net/genetlink.h: * genlmsg_multicast_allns - multicast a netlink message to all net namespaces
linux-6.6.58/include/net/genetlink.h:int genlmsg_multicast_allns(const struct genl_family *family,
linux-6.6.58/drivers/target/target_core_user.c: ret = genlmsg_multicast_allns(&tcmu_genl_family, skb, 0,
linux-6.6.58/net/l2tp/l2tp_netlink.c: ret = genlmsg_multicast_allns(family, msg, 0, 0, GFP_ATOMIC);
linux-6.6.58/net/l2tp/l2tp_netlink.c: ret = genlmsg_multicast_allns(family, msg, 0, 0, GFP_ATOMIC);
linux-6.6.58/net/netlink/genetlink.c: genlmsg_multicast_allns(&genl_ctrl, msg, 0,
linux-6.6.58/net/netlink/genetlink.c:int genlmsg_multicast_allns(const struct genl_family *family,
linux-6.6.58/net/netlink/genetlink.c:EXPORT_SYMBOL(genlmsg_multicast_allns);
linux-6.6.58/net/wireless/nl80211.c: genlmsg_multicast_allns(&nl80211_fam, msg, 0,
linux-6.6.58/net/wireless/nl80211.c: genlmsg_multicast_allns(&nl80211_fam, msg, 0,
linux-6.6.59/include/net/genetlink.h: * genlmsg_multicast_allns - multicast a netlink message to all net namespaces
linux-6.6.59/include/net/genetlink.h:int genlmsg_multicast_allns(const struct genl_family *family,
linux-6.6.59/drivers/target/target_core_user.c: ret = genlmsg_multicast_allns(&tcmu_genl_family, skb, 0,
linux-6.6.59/net/l2tp/l2tp_netlink.c: ret = genlmsg_multicast_allns(family, msg, 0, 0);
linux-6.6.59/net/l2tp/l2tp_netlink.c: ret = genlmsg_multicast_allns(family, msg, 0, 0);
linux-6.6.59/net/netlink/genetlink.c: genlmsg_multicast_allns(&genl_ctrl, msg, 0, 0);
linux-6.6.59/net/netlink/genetlink.c:int genlmsg_multicast_allns(const struct genl_family *family,
linux-6.6.59/net/netlink/genetlink.c:EXPORT_SYMBOL(genlmsg_multicast_allns);
linux-6.6.59/net/wireless/nl80211.c: genlmsg_multicast_allns(&nl80211_fam, msg, 0,
linux-6.6.59/net/wireless/nl80211.c: genlmsg_multicast_allns(&nl80211_fam, msg, 0,

Can build on 6.6.58:
.======================================================================.

KDIR=/lib/modules/6.6.58/build

KERNELVERSION=6.6.58

KERNELRELEASE=6.6.58

/usr/src/drbd-9.2.11/drbd/build-6.6.58/

drbd.ko

drbd_transport_lb-tcp.ko

drbd_transport_tcp.ko

‘======================================================================’
make[1]: Leaving directory ‘/usr/src/drbd-9.2.11/drbd’

    Module build was successful.

I was able to solve this by upgrading to the latest 9.1.x point release, according to their support department, upgrading to latest 9.2.x release should also fix it.