openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.54k stars 1.74k forks source link

CentOS Stream 9 : Kernel 5.14.0 : Doesn't compile for ZFS 2.1.4 - 2.1.6 #14847

Open MynaITLabs opened 1 year ago

MynaITLabs commented 1 year ago

System information

Type Version/Name
Distribution Name CentOS Stream
Distribution Version 9 (as of 5/9/2023)
Kernel Version 5.14.0-305.el9.x86_64
Architecture x86_64
OpenZFS Version 2.1.4 - 2.1.6

Describe the problem you're observing

When compiling from source, there are fatal errors preventing completion. Version Release Kernel Support No work / works

2.1.4 2022 03 23 3.10 - 5.17 kernels no work K 5.14.0 ?

2.1.5 2022 06 22 3.10 - 5.18 kernels no work K 5.14.0 ?

2.1.6 2022 10 03 3.10 - 5.19 kernels no work K 5.14.0 ?

2.1.8 2023 01 20 3.10 - 6.1 kernels works K 5.14.0

2.1.9 2023 01 25 3.10 - 6.1 kernels works K 5.14.0

2.1.10 2023 04 ?? 3.10 - 6.2 kernels works K 5.14.0

2.1.11 2023 04 ?? 3.10 - 6.2 kernels works K 5.14.0

Describe how to reproduce the problem

Download source, set release compile. $ sudo -s $ cd /usr/local/sbin $ git clone https://github.com/openzfs/zfs $ cd zfs $ ZFS_VER="zfs-2.1.4"

$ git pull origin master $ git checkout ${ZFS_VER}

$ ./autogen.sh && ./configure && make -j && sudo make install

Include any warning/errors/backtraces from the system logs

checking whether bio has bi_iter... yes
checking whether submit_bio() wants 1 arg... yes
checking whether current->bio_list exists... yes
checking whether blkg_tryget() is available... no
checking whether bio->bi_bdev->bd_disk exists... yes
checking whether block_device_operations->submit_bio() returns void... yes
checking for existence of linux/blk-cgroup.h... yes
checking whether blkdev_get_by_path() exists... yes
checking whether blkdev_put() exists... yes
checking whether blkdev_reread_part() exists... no
checking whether invalidate_bdev() exists... yes
checking whether lookup_bdev() wants dev_t arg... yes
checking whether bdev_logical_block_size() is available... yes
checking whether bdev_physical_block_size() is available... yes
checking whether check_disk_change() exists... no
checking whether bdev_check_media_change() exists... yes
checking whether bdev_whole() is available... yes
checking whether blkdev_get_by_path() handles ERESTARTSYS... no
checking whether struct blk_plug is available... yes
checking whether blk_queue bdi is dynamic... no
checking whether blk_queue_update_readahead() exists... checking whether disk_update_readahead() exists... yes
checking whether blk_queue_discard() is available... configure: error:
        *** None of the expected "blk_queue_discard" 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.4-1
        *** Compatible Kernels: 3.10 - 5.17
MynaITLabs commented 1 year ago

FYI, more background info . . a clean CentOS Stream 9 (updated as of May 9th 2023) with kernel 5.14.0-305.el9.x86_64 . Compiling source code for release 2.1.4, 2.1.5, 2.1.6 doesn't work (fails on error). Compiling source code for release 2.1.8, 2.1.9, 2.1.10, 2.1.11 compiles and installs fine. (tested by bouncing between version numbers, compile-test, then picking a new zfs version, compile again.. no reboots between)

behlendorf commented 1 year ago

The CentOS/RHEL kernels are well known for backporting many upstream changes in to their base kernel version. Or in other words this is a heavily patched 5.14 kernel, one where it looks like they've pulled in a 5.19 patch that modifies the blk_queue_discard interface ZFS was using. The ZFS compatibility code for this, commit 7ae5ea8864d7a0cbf63feb61bd9022adc803b60d, was added to the zfs-2.1.5 release. It's likely the zfs-2.1.5 and zfs-2.1.6 build failures you're seeing are caused by backports from even newer kernels.

There's nothing we can really do about what RedHat chooses to backport. You'll just need to make sure you're using a new enough OpenZFS version which includes the needed patches to detect those modified kernel interfaces.

MynaITLabs commented 2 months ago

Hmm.. how about this for a compromise? Update the version compatibility docs to reflect the discovery that some ZFS versions are not compatible with Kernel version 5.14.0?