zfs icon indicating copy to clipboard operation
zfs copied to clipboard

zfs-2.1.15 don't compile with Centos last kernel-5.14.0-446.el9.x86_64

Open smusich opened this issue 1 year ago • 11 comments

<checking whether bio_alloc() wants 4 args... yes checking whether blkdev_get_by_path() exists and takes 3 args... no checking whether blkdev_get_by_path() exists and takes 4 args... no checking whether bdev_open_by_path() exists... configure: error: *** None of the expected "blkdev_get_by_path()" interfaces were detected. *** This may be because your kernel version is newer than what is *** supported, or you are using a patched custom kernel with *** incompatible modifications. *** *** ZFS Version: zfs-2.1.15-2 *** Compatible Kernels: 3.10 - 6.7

Building module: Cleaning build area...(bad exit status: 2) Failed command: make -C /lib/modules/5.14.0-446.el9.x86_64/build M=/var/lib/dkms/zfs/2.1.15/build clean Building module(s)...(bad exit status: 2) Failed command: make -j12 KERNELRELEASE=5.14.0-446.el9.x86_64 Error! Bad return status for module build on kernel: 5.14.0-446.el9.x86_64 (x86_64) Consult /var/lib/dkms/zfs/2.1.15/build/make.log for more information. dkms autoinstall on 5.14.0-446.el9.x86_64/x86_64 succeeded for nvidia dkms autoinstall on 5.14.0-446.el9.x86_64/x86_64 failed for zfs(10) Error! One or more modules failed to install during autoinstall. Refer to previous errors for more information. dkms: autoinstall for kernel 5.14.0-446.el9.x86_64 Failed.

smusich avatar May 14 '24 15:05 smusich

don't compile with Centos last kernel-5.14.0-446.el9.x86_64

Which distro are you running specifically?

zfs-2.1.15 builds on AlmaLinux 9.4 with the latest 5.14.0-427.16.1.el9_4.x86_64 kernel:

$ ./autogen.sh && ./configure && make -j `nproc`
...
Skipping BTF generation for /home/hutter/zfs/module/zcommon/zcommon.ko due to unavailability of vmlinux
  BTF [M] /home/hutter/zfs/module/zfs/zfs.ko
Skipping BTF generation for /home/hutter/zfs/module/zfs/zfs.ko due to unavailability of vmlinux
make[3]: Leaving directory '/usr/src/kernels/5.14.0-427.16.1.el9_4.x86_64'
make[2]: Leaving directory '/home/hutter/zfs/module'
make[2]: Entering directory '/home/hutter/zfs'
[ -x ./scripts/zfs-tests.sh ] && \
    ./scripts/zfs-tests.sh -c
make[2]: Leaving directory '/home/hutter/zfs'
make[1]: Leaving directory '/home/hutter/zfs'

$ sudo ./cmd/zfs/zfs --version
zfs-2.1.15-1
zfs-kmod-2.1.15-1

$ uname -a
Linux centos9 5.14.0-427.16.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 9 18:15:59 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/redhat-release 
AlmaLinux release 9.4 (Seafoam Ocelot)

tonyhutter avatar May 14 '24 17:05 tonyhutter

Distro: Centos Stream 9, with Centos-Stream 9 kernel-5.14.0-444.el9.x86_64 compile is fine.

smusich avatar May 14 '24 19:05 smusich

Unfortunately we don't support CentOS stream

tonyhutter avatar May 14 '24 19:05 tonyhutter

Counter point. CentOS Stream is previewing the upcoming changes to RHEL, AlmaLinux, and RockyLinux. Those distros will soon pick up this backported kernel version 6.9 change (which I know 6.9 isn't fully supported yet either). I've tracked down this particular code change to this commit. https://github.com/torvalds/linux/commit/e97d06a46526d9392cbdbd7eda193091e1af2723 If there's a "Support kernel version 6.9" issue somewhere, I think we could mark this a duplicate of that ticket.

Additionally, downgrading to kernel 5.14.0-444.el9.x86_64 will work for CentOS Stream 9 users. So it's only this brand new 446 kernel package that has new code.

kai4785 avatar May 16 '24 22:05 kai4785

Maybe someone is interested for Centos 9 you can easily assemble zfs-2.2.4 from srpm fedora 40, with kernel 446 everything seems to work.

smusich avatar May 20 '24 15:05 smusich

@smusich you should also be able to install the EL9 dkms packages as well. That should alleviate the issues when the RHEL/Alma/Rocky/Stream kernel version numbers are not 100% matched up.

tonyhutter avatar May 20 '24 16:05 tonyhutter

zfs-dkms is also needed from fedora

smusich avatar May 21 '24 11:05 smusich

@smusich I simply used the Fedora 38 repo. Works without any further changes. Just needed to hardcode the fedora release version.

@tonyhutter I believe we are both already on zfs-dkms via epel/zfs-release-2-3.el9 as instructed in the current "Getting Started" section.

Btw. since I was not aware that Centos-Stream was not supported, that might be sth. to clarify on that Getting Started page. Since Stream has existed for a while and the non-Stream variants had been discontinued, I simply counted "CentOS-Stream" as covered under "CentOS-based distros".

ramonwirsch avatar May 21 '24 11:05 ramonwirsch

@ramonwirsch I use Fedora 40 repo. I'm currently running a test from the package zfs-test.

smusich avatar May 21 '24 12:05 smusich

You can cherry-pick these commits and it seems to build again (they cherry-pick cleanly)

https://github.com/openzfs/zfs/commit/cfb96c772b8448dca6eaeb66a540b8bb39c9908c https://github.com/openzfs/zfs/commit/e3120f73d0481a5e0779e45da83518373d60dcff

hjmallon avatar Jul 08 '24 17:07 hjmallon

What goes inte CentOS Stream usually ends up in the next RHEL release. On RHEL 9.5 beta (currently kernel-5.14.0-503.2.1.el9_5.x86_64), zfs-2.1.15 does build with the two cherry-picks suggested above.

Are there still plans to release zfs-2.1.16? If so, will it be supported on RHEL 9.5?

nscfreny avatar Oct 08 '24 20:10 nscfreny

Using zfs-testing worked for me. Current kernel - 5.14.0-522.el9.x86_64

dnf install https://zfsonlinux.org/epel/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm

dnf install -y epel-release
dnf config-manager --enable zfs-testing
dnf install kernel-devel zfs

This will install zfs-2.2.6 instead of zfs-2.1.15. Will compile kernel modules and zfs-dkms. Manual build from source zfs-2.2.6 also works.

Don't forget to rebuild initrd: dracut --regenerate-all -f

Trogvars avatar Oct 28 '24 14:10 Trogvars

AlmaLinux 9.5 has been released with kernel 5.14.0-503.11.1.el9_5.x86_64 and compiling zfs 2.1.15 sources fails with

checking whether bdev_open_by_path() exists... configure: error: 
	*** None of the expected "blkdev_get_by_path()" interfaces were detected.

Will there be an official 2.1.16 release?

If not, is it safe and sufficient to apply patches cfb96c7 and e3120f7? I've successfully built a custom 2.1.16pre RPM including those patches, but I don't know if this may cause issues on production servers later on.

gcoretech avatar Nov 20 '24 06:11 gcoretech

@gcoretech https://github.com/openzfs/zfs/issues/16746 https://github.com/openzfs/zfs/pull/16781

AllKind avatar Nov 20 '24 11:11 AllKind