View Issue Details

IDProjectCategoryView StatusLast Update
0001284channel: elrepo/el9kmod-drbd90public2022-11-16 13:04
Reportertoracat Assigned Totoracat  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Summary0001284: Build kmod-drbd9x for EL 9.1
Description<< Attempt to build kmod-drbd9x in EL 9.1 beta >>

kernel version: 5.14.0-160.el9.x86_64
drbd9x version: 9.1.11 (from linbit)

(1) Build error:

/home/yagi2/rpmbuild/elrepo/drbd9x/BUILD/drbd-9.1.11/drbd/drbd_sender.c: In function 'drbd_csum_bio':
/home/yagi2/rpmbuild/elrepo/drbd9x/BUILD/drbd-9.1.11/drbd/drbd_sender.c:360:36: error: 'REQ_OP_WRITE_SAME' undeclared (first use in this function); did you mean 'REQ_OP_WRITE_ZEROES'?
  360 | if (bio_op(bio) == REQ_OP_WRITE_SAME)

- This happens because the kernel in the 9.1 beta backported a commit that removes WRITE_SAME support (kernel commit a34592ff6b78e84e11b19183b60cd240737f76f9).

(2) Patch

A patch to fix that issue was made available here :

https://github.com/LINBIT/drbd/commit/6842600a876d6cc4ae48f1a6735561b8ba9c5920

 drbd: remove WRITE_SAME support

This commit mimics upstream commit a34592ff6b78, which removes all the
WRITE_SAME code because "REQ_OP_WRITE_SAME was only ever submitted by
the legacy Linux zeroing code, which has switched to use
REQ_OP_WRITE_ZEROES long ago." WRITE_SAME was then removed from Linux
5.18.

- This commit was backported to 9.1.11. However that led to new build errors.

(3) Latest source code from linbit git

git clone https://github.com/LINBIT/drbd.git
cd drbd

- Now, building the package within the git tree had many problems.
(details omitted)

- Generating a release tarball is one solution.

make prepare_release => this created drbd-9.1.11.tar.gz

- In the top level Makefile of the tarfile, comment out:

# drbd/.drbd_git_revision:
# @echo >&2 "Need a git checkout to regenerate $@"; test -s $@

- Then kmod build succeeded with the modified tarfile.

<Note> for successful build, coccinelle was required. This is available from EPEL for el8 but not for el9. So it was installed from Fedora 34 together with its dependencies.

coccinelle-1.0.9-0.17.gitd0fd4c7d.fc34.x86_64.rpm
ocaml-4.11.1-2.fc34.x86_64.rpm
ocaml-compiler-libs-4.11.1-2.fc34.x86_64.rpm
ocaml-findlib-1.8.1-23.fc34.x86_64.rpm
ocaml-runtime-4.11.1-2.fc34.x86_64.rpm

ref: https://lists.linbit.com/pipermail/drbd-user/2022-November/026327.html

(4) Test install

$ find /lib/modules -name drbd.ko
/lib/modules/5.14.0-160.el9.x86_64/extra/drbd9x/drbd.ko
$ dmesg | tail -5
[ 261.067921] drbd: loading out-of-tree module taints kernel.
[ 261.068038] drbd: module verification failed: signature and/or required key missing - tainting kernel
[ 261.078497] drbd: initialized. Version: 9.1.11 (api:2/proto:86-121)
[ 261.078499] drbd: GIT-hash: bbbef4d2b29e220fc4973c7f34d85edc00d349d0 build by yagi2@91beta, 2022-11-04 10:07:54
[ 261.078500] drbd: registered as block device major 147
$ lsmod | head -2
Module Size Used by
drbd 675840 0

- As expected, it failed to install on EL 9.0
TagsNo tags attached.

Activities

toracat

2022-11-14 12:12

administrator   ~0008733

drbd-9.1.12 is out just in time for 9.1.

This builds cleanly on 9.1 beta.

toracat

2022-11-16 13:04

administrator   ~0008746

RHEL 9.1 has just been released. drbd-9.1.12 builds cleanly, with no requirement for coccinelle.

kmod-drbd9x-9.1.12-1.el9_1.elrepo.x86_64.rpm

Issue History

Date Modified Username Field Change
2022-11-12 19:48 toracat New Issue
2022-11-12 19:48 toracat Status new => assigned
2022-11-12 19:48 toracat Assigned To => toracat
2022-11-12 19:50 toracat Description Updated
2022-11-12 19:52 toracat Description Updated
2022-11-14 12:12 toracat Note Added: 0008733
2022-11-16 13:04 toracat Note Added: 0008746
2022-11-16 13:04 toracat Status assigned => resolved
2022-11-16 13:04 toracat Resolution open => fixed