LINBIT / drbd

LINBIT DRBD kernel module
https://docs.linbit.com/docs/users-guide-9.0/
GNU General Public License v2.0
580 stars 100 forks source link

drbd fails to compile in debian 11 bullseye with pve-kernel. commit 998a1fa did not resolve #33

Closed quiknick closed 2 years ago

quiknick commented 2 years ago

Still fails even with those commit changes on branch drbd-9.1 and changes from commit 998a1fa

make[1]: Entering directory '/opt/drbd/drbd'

    Calling toplevel makefile of kernel source tree, which I believe is in
    KDIR=/lib/modules/5.15.30-1-pve/build

make -C /lib/modules/5.15.30-1-pve/build   M=/opt/drbd/drbd  modules
  COMPAT  __vmalloc_has_2_params
  COMPAT  before_4_13_kernel_read
  COMPAT  blkdev_issue_zeroout_discard
  COMPAT  can_include_vermagic_h
  COMPAT  genl_policy_in_ops
  COMPAT  have_BIO_MAX_VECS
  COMPAT  have_CRYPTO_TFM_NEED_KEY
  COMPAT  have_SHASH_DESC_ON_STACK
  COMPAT  have_WB_congested_enum
  COMPAT  have_allow_kernel_signal
  COMPAT  have_bdi_congested_fn
  COMPAT  have_bio_bi_bdev
  COMPAT  have_bio_bi_error
  COMPAT  have_bio_bi_opf
  COMPAT  have_bio_bi_status
  COMPAT  have_bio_clone_fast
  COMPAT  have_bio_op_shift
  COMPAT  have_bio_set_dev
  COMPAT  have_bio_set_op_attrs
  COMPAT  have_bio_start_io_acct
  COMPAT  have_bioset_init
  COMPAT  have_bioset_need_bvecs
  COMPAT  have_blk_alloc_disk
  COMPAT  have_blk_alloc_queue_rh
  COMPAT  have_blk_check_plugged
  COMPAT  have_blk_qc_t_make_request
  COMPAT  have_blk_queue_flag_set
  COMPAT  have_blk_queue_make_request
  COMPAT  have_blk_queue_merge_bvec
  COMPAT  have_blk_queue_split_bio
  COMPAT  have_blk_queue_split_q_bio
  COMPAT  have_blk_queue_split_q_bio_bioset
  COMPAT  have_blk_queue_update_readahead
  COMPAT  have_blk_queue_write_cache
  COMPAT  have_d_inode
  COMPAT  have_disk_update_readahead
  COMPAT  have_fallthrough
  COMPAT  have_generic_start_io_acct_q_rw_sect_part
  COMPAT  have_generic_start_io_acct_rw_sect_part
  COMPAT  have_genl_family_parallel_ops
  COMPAT  have_hd_struct
  COMPAT  have_ib_cq_init_attr
  COMPAT  have_ib_get_dma_mr
  COMPAT  have_idr_is_empty
  COMPAT  have_inode_lock
  COMPAT  have_ktime_to_timespec64
  COMPAT  have_kvfree
  COMPAT  have_max_send_recv_sge
  COMPAT  have_nla_nest_start_noflag
  COMPAT  have_nla_parse_deprecated
  COMPAT  have_nla_put_64bit
  COMPAT  have_nla_strscpy
  COMPAT  have_part_stat_h
  COMPAT  have_part_stat_read_accum
  COMPAT  have_pointer_backing_dev_info
  COMPAT  have_proc_create_single
  COMPAT  have_queue_flag_stable_writes
  COMPAT  have_rb_declare_callbacks_max
  COMPAT  have_refcount_inc
  COMPAT  have_req_hardbarrier
  COMPAT  have_req_noidle
  COMPAT  have_req_nounmap
  COMPAT  have_req_op_write
  COMPAT  have_req_op_write_zeroes
  COMPAT  have_req_write
  COMPAT  have_revalidate_disk_size
  COMPAT  have_sched_set_fifo
  COMPAT  have_security_netlink_recv
  COMPAT  have_sendpage_ok
  COMPAT  have_set_capacity_and_notify
  COMPAT  have_shash_desc_zero
  COMPAT  have_simple_positive
  COMPAT  have_sock_set_keepalive
  COMPAT  have_struct_bvec_iter
  COMPAT  have_struct_size
  COMPAT  have_submit_bio
  COMPAT  have_submit_bio_noacct
  COMPAT  have_tcp_sock_set_cork
  COMPAT  have_tcp_sock_set_nodelay
  COMPAT  have_tcp_sock_set_quickack
  COMPAT  have_time64_to_tm
  COMPAT  have_timer_setup
  COMPAT  have_void_make_request
  COMPAT  ib_alloc_pd_has_2_params
  COMPAT  ib_device_has_ops
  COMPAT  ib_post_send_const_params
  COMPAT  ib_query_device_has_3_params
  COMPAT  need_make_request_recursion
  COMPAT  part_stat_read_takes_block_device
  COMPAT  queue_limits_has_discard_zeroes_data
  COMPAT  rdma_create_id_has_net_ns
  COMPAT  sock_create_kern_has_five_parameters
  COMPAT  sock_ops_returns_addr_len
  UPD     /opt/drbd/drbd/compat.5.15.30-1-pve.h
  UPD     /opt/drbd/drbd/compat.h
  GENPATCHNAMES   5.15.30-1-pve
  SPATCH   610ca2503f32322b806dc438e639448a  5.15.30-1-pve
  PATCH
patching file drbd_req.c
patching file drbd_receiver.c
patching file drbd_nl.c
patching file drbd_main.c
patching file drbd_debugfs.c
patching file drbd-headers/linux/genl_magic_func.h
Hunk #2 succeeded at 312 (offset -20 lines).
  CC [M]  /opt/drbd/drbd/drbd_dax_pmem.o
  CC [M]  /opt/drbd/drbd/drbd_debugfs.o
  CC [M]  /opt/drbd/drbd/drbd_bitmap.o
  CC [M]  /opt/drbd/drbd/drbd_proc.o
  CC [M]  /opt/drbd/drbd/drbd_sender.o
  CC [M]  /opt/drbd/drbd/drbd_receiver.o
  CC [M]  /opt/drbd/drbd/drbd_req.o
/opt/drbd/drbd/drbd_req.c: In function ‘remote_due_to_read_balancing’:
/opt/drbd/drbd/drbd_req.c:1238:52: error: ‘struct request_queue’ has no member named ‘backing_dev_info’
 1238 |   bdi =& device->ldev->backing_bdev->bd_disk->queue->backing_dev_info;
      |                                                    ^~
make[3]: *** [scripts/Makefile.build:285: /opt/drbd/drbd/drbd_req.o] Error 1
make[2]: *** [Makefile:1875: /opt/drbd/drbd] Error 2
make[1]: *** [Makefile:132: kbuild] Error 2
make[1]: Leaving directory '/opt/drbd/drbd'
make: *** [Makefile:125: module] Error 2

Originally posted by @quiknick in https://github.com/LINBIT/drbd/issues/32#issuecomment-1092455993

chrboe commented 2 years ago

Sorry, I probably should have been more specific.

All the commits from 860bee1b7424337aefef6a802d0e514289c232eb to 0432333222ebee9ca4c73d8c18d3783db8525ae0 are needed for 5.15 compat.

We have a somewhat, let's say, unique approach to maintaining older versions of DRBD. Basically, we implement features that should be backported on the older branch first (that is 9.0 in that case). Then, we merge them "forward" to the newer branches.

Anway, long story short: the fixes for 5.15 compat are on the 9.0 branch, but not yet on 9.1. Good news is I'm literally doing that right now, so 9.1 will also have it within the day.

chrboe commented 2 years ago

@quiknick this should now work on the 9.1 branch, please try it.

quiknick commented 2 years ago

@chrboe Compile successful. Thank you! You're the man! Made my Friday great again!