LINBIT / drbd

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

drbd-9.1.7 & upstream build errors on Centos Stream 9 #42

Closed arnaudveron closed 2 years ago

arnaudveron commented 2 years ago

Hi

I'm trying to build drbd from source (9.1.7 tarball and upstream) on Centos Stream 9 (20220705). Both ends with same errors, as per log below:

9.1.7 tarball error log

[root@node drbd-9.1.7]# make
Need a git checkout to regenerate drbd/.drbd_git_revision
make[1]: Entering directory '/root/drbd-9.1.7/drbd'

    Calling toplevel makefile of kernel source tree, which I believe is in
    KDIR=/lib/modules/5.14.0-124.el9.x86_64/build

make -C /lib/modules/5.14.0-124.el9.x86_64/build   M=/root/drbd-9.1.7/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_bdgrab
  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_qc_t_submit_bio
  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_fs_dax_get_by_bdev
  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_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  have_void_submit_bio
  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
  COMPAT  struct_gendisk_has_backing_dev_info
make[4]: 'drbd-kernel-compat/cocci_cache/46bccf002fae330baad3a38b6ebe0a06/compat.patch' is up to date.
  PATCH
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]  /root/drbd-9.1.7/drbd/drbd_dax_pmem.o
  CC [M]  /root/drbd-9.1.7/drbd/drbd_debugfs.o
  CC [M]  /root/drbd-9.1.7/drbd/drbd_bitmap.o
In file included from ./include/linux/slab.h:15,
                 from /root/drbd-9.1.7/drbd/drbd_bitmap.c:19:
/root/drbd-9.1.7/drbd/drbd_bitmap.c: In function ‘bm_page_io_async’:
./include/linux/gfp.h:327:25: warning: passing argument 1 of ‘bio_alloc_bioset’ makes pointer from integer without a cast [-Wint-conversion]
  327 | #define GFP_NOIO        (__GFP_RECLAIM)
      |                         ^~~~~~~~~~~~~~~
      |                         |
      |                         unsigned int
/root/drbd-9.1.7/drbd/drbd_bitmap.c:1188:32: note: in expansion of macro ‘GFP_NOIO’
 1188 |         bio = bio_alloc_bioset(GFP_NOIO, 1, &drbd_md_io_bio_set);
      |                                ^~~~~~~~
In file included from ./include/linux/libnvdimm.h:14,
                 from /root/drbd-9.1.7/drbd/drbd_bitmap.c:21:
./include/linux/bio.h:408:51: note: expected ‘struct block_device *’ but argument is of type ‘unsigned int’
  408 | struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs,
      |                              ~~~~~~~~~~~~~~~~~~~~~^~~~
/root/drbd-9.1.7/drbd/drbd_bitmap.c:1188:45: warning: passing argument 3 of ‘bio_alloc_bioset’ makes integer from pointer without a cast [-Wint-conversion]
 1188 |         bio = bio_alloc_bioset(GFP_NOIO, 1, &drbd_md_io_bio_set);
      |                                             ^~~~~~~~~~~~~~~~~~~
      |                                             |
      |                                             struct bio_set *
In file included from ./include/linux/libnvdimm.h:14,
                 from /root/drbd-9.1.7/drbd/drbd_bitmap.c:21:
./include/linux/bio.h:409:43: note: expected ‘unsigned int’ but argument is of type ‘struct bio_set *’
  409 |                              unsigned int opf, gfp_t gfp_mask,
      |                              ~~~~~~~~~~~~~^~~
/root/drbd-9.1.7/drbd/drbd_bitmap.c:1188:15: error: too few arguments to function ‘bio_alloc_bioset’
 1188 |         bio = bio_alloc_bioset(GFP_NOIO, 1, &drbd_md_io_bio_set);
      |               ^~~~~~~~~~~~~~~~
In file included from ./include/linux/libnvdimm.h:14,
                 from /root/drbd-9.1.7/drbd/drbd_bitmap.c:21:
./include/linux/bio.h:408:13: note: declared here
  408 | struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs,
      |             ^~~~~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:271: /root/drbd-9.1.7/drbd/drbd_bitmap.o] Error 1
make[2]: *** [Makefile:1881: /root/drbd-9.1.7/drbd] Error 2
make[1]: *** [Makefile:132: kbuild] Error 2
make[1]: Leaving directory '/root/drbd-9.1.7/drbd'
make: *** [Makefile:125: module] Error 2

upstream git repo error log

[root@node drbd]# git remote -vv
origin  https://github.com/LINBIT/drbd.git (fetch)
origin  https://github.com/LINBIT/drbd.git (push)
[root@node drbd]# git branch
* drbd-9.1
[root@node drbd]# git log -p | head -5
commit 34a655ba957f25d05ad8bb88f5d3dc408b50bd9a
Author: Philipp Reisner <philipp.reisner@linbit.com>
Date:   Wed Jul 6 17:44:32 2022 +0200

    Prepare drbd-9.1.8-rc.1

[root@node drbd]# git status
On branch drbd-9.1
Your branch is up to date with 'origin/drbd-9.1'.

nothing to commit, working tree clean
[root@node drbd]# make
make[1]: Entering directory '/root/drbd/drbd'

    Calling toplevel makefile of kernel source tree, which I believe is in
    KDIR=/lib/modules/5.14.0-124.el9.x86_64/build

make -C /lib/modules/5.14.0-124.el9.x86_64/build   M=/root/drbd/drbd  modules
  PATCH
patching file drbd_receiver.c
patching file drbd_nl.c
patching file drbd_main.c
patching file drbd_debugfs.c
patching file drbd_dax_pmem.c
  CC [M]  /root/drbd/drbd/drbd_dax_pmem.o
  CC [M]  /root/drbd/drbd/drbd_debugfs.o
  CC [M]  /root/drbd/drbd/drbd_bitmap.o
In file included from ./include/linux/slab.h:15,
                 from /root/drbd/drbd/drbd_bitmap.c:19:
/root/drbd/drbd/drbd_bitmap.c: In function ‘bm_page_io_async’:
./include/linux/gfp.h:327:25: warning: passing argument 1 of ‘bio_alloc_bioset’ makes pointer from integer without a cast [-Wint-conversion]
  327 | #define GFP_NOIO        (__GFP_RECLAIM)
      |                         ^~~~~~~~~~~~~~~
      |                         |
      |                         unsigned int
/root/drbd/drbd/drbd_bitmap.c:1188:32: note: in expansion of macro ‘GFP_NOIO’
 1188 |         bio = bio_alloc_bioset(GFP_NOIO, 1, &drbd_md_io_bio_set);
      |                                ^~~~~~~~
In file included from ./include/linux/libnvdimm.h:14,
                 from /root/drbd/drbd/drbd_bitmap.c:21:
./include/linux/bio.h:408:51: note: expected ‘struct block_device *’ but argument is of type ‘unsigned int’
  408 | struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs,
      |                              ~~~~~~~~~~~~~~~~~~~~~^~~~
/root/drbd/drbd/drbd_bitmap.c:1188:45: warning: passing argument 3 of ‘bio_alloc_bioset’ makes integer from pointer without a cast [-Wint-conversion]
 1188 |         bio = bio_alloc_bioset(GFP_NOIO, 1, &drbd_md_io_bio_set);
      |                                             ^~~~~~~~~~~~~~~~~~~
      |                                             |
      |                                             struct bio_set *
In file included from ./include/linux/libnvdimm.h:14,
                 from /root/drbd/drbd/drbd_bitmap.c:21:
./include/linux/bio.h:409:43: note: expected ‘unsigned int’ but argument is of type ‘struct bio_set *’
  409 |                              unsigned int opf, gfp_t gfp_mask,
      |                              ~~~~~~~~~~~~~^~~
/root/drbd/drbd/drbd_bitmap.c:1188:15: error: too few arguments to function ‘bio_alloc_bioset’
 1188 |         bio = bio_alloc_bioset(GFP_NOIO, 1, &drbd_md_io_bio_set);
      |               ^~~~~~~~~~~~~~~~
In file included from ./include/linux/libnvdimm.h:14,
                 from /root/drbd/drbd/drbd_bitmap.c:21:
./include/linux/bio.h:408:13: note: declared here
  408 | struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs,
      |             ^~~~~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:271: /root/drbd/drbd/drbd_bitmap.o] Error 1
make[2]: *** [Makefile:1881: /root/drbd/drbd] Error 2
make[1]: *** [Makefile:134: kbuild] Error 2
make[1]: Leaving directory '/root/drbd/drbd'
make: *** [Makefile:126: module] Error 2

I can provide ssh access to the box if it can help troubleshoot.

rck commented 2 years ago

that kind of question has been answered several times, I will make sure we add a section to the Readme.md:

rck commented 2 years ago

fwiw centos stream isn't a distribution we care about too deeply/test on releases, it might work because the compat code is good enough (or it isn't). In that area we care about RHEL kernels and therefore one can expect that almalinux and rocky linux will work.

arnaudveron commented 2 years ago

Thanks for answering. 9.1.8-rc1 and 9.2.0-rc6 do not work (same errors)

rck commented 2 years ago

@chrboe might know if there is some compat work missing or planed between the RC and final? I'm a bit surprised as that centos kernel is not too far from the RHEL kernel. but as I said, there won't be any extra work for centos stream, you might be lucky if latest upstream compat is missing and fixes that issue as well.