zfs icon indicating copy to clipboard operation
zfs copied to clipboard

Linux 6 compatibility in and tracking discussion of the 2.1.7 patchset

Open almereyda opened this issue 3 years ago • 13 comments

Describe the feature would like to see added to OpenZFS

I would like to see the META file increase the Linux version to 6, in order to allow for builds against newer Kernels.

How will this feature improve OpenZFS?

This will allow to build in rolling release and fast-paced distributions, such as Gentoo, Arch Linux, NixOS or Fedora.

Additional context

It has previously been suggested to already open a tracking PR for the zfs-2.1.7-staging branch:

  • https://github.com/openzfs/zfs/pull/13886#issuecomment-1272240751

It was previously stated that LInux 6 compatibility is already present in zfs-2.1.6-staging, but not thoroughly tested:

  • https://github.com/openzfs/zfs/issues/13916#issuecomment-1276494782

A PR for tracking the status of the zfs-2.1.7-staging branch has the advantage over merely comparing the branch against master, that discussions can be held and further code review employed.

  • https://github.com/openzfs/zfs/compare/zfs-2.1.7-staging

almereyda avatar Oct 12 '22 19:10 almereyda

The situation is quite disappointing actually, and that's not for the first (and even not for the second!) time. Now I'm left with 2.1.6 and EOLed 5.19 kernel in gentoo. As it is not known which kernel version would become the next LTS, I have no other realistic option except for downgrading to 5.15.

lvd2 avatar Oct 25 '22 12:10 lvd2

@lvd2 While it is not 100% percent certain, 6.1 is likely to be the next LTS kernel. Though that is assuming nothing unexpected happens during Linux development and testing.

DerVerruckteFuchs avatar Oct 26 '22 02:10 DerVerruckteFuchs

@lvd2 at least you have the option of downgrading--my laptop won't work prior to 5.17 or 18 (and has severe bugs < 5.19). I'm hoping nixpkgs holds onto the kernel a little longer than normal.

toastal avatar Oct 26 '22 04:10 toastal

The version in the META file represents latest kernel which we have tested. Fast moving downstream distributions, and end users building from source, are always welcome to perform their own testing and bump that max version as they see fit. What we want to avoid is misleading anyone about what has, and has not, been tested by the developers.

behlendorf avatar Oct 26 '22 20:10 behlendorf

On a Fedora 36 machine, with the 2.1.6 sources installed to /usr/src/zfs-2.1.6/ through dnf download --source zfs and rpm -ivh zfs-2.1.6-1.fc36.src.rpm, the build succeeded on their recent Linux 6 kernel with patching META to 6 and installing the DKMS module manually:

$ sed -i 's/Linux-Maximum: 5.19/Linux-Maximum: 6.00/g' /usr/src/zfs-2.1.6/META
$ dkms install zfs/2.1.6
$ modprobe zfs
$ zfs version
zfs-2.1.6-1
zfs-kmod-2.1.6-1
$ uname -r
6.0.5-200.fc36.x86_64

almereyda avatar Oct 31 '22 02:10 almereyda

Can someone help me,too ? I've tried several methods and actually I'm confused. I'm on Ubuntu 22.10 kinetic with the "6.0.0-6.1-liquorix-amd64" kernel. I tried to repeat your commands,but in my case it didn't work. Can you give a look at the log below ? thanks.

https://pastebin.ubuntu.com/p/KwgByTtNpr/

this is the META file located inside the folder /usr/src/zfs-2.1.99 :

Meta:          1
Name:          zfs
Branch:        1.0
Version:       2.1.99
Release:       1521_gb37d495e0
Release-Tags:  relext
License:       CDDL
Author:        OpenZFS
Linux-Maximum: 6.0
Linux-Minimum: 3.10

on /usr/src I have another folder,called zfs-2.1.6 and inside of it there is only one file,called META6,that has this content inside

Meta:          1
Name:          zfs
Branch:        1.0
Version:       2.1.6
Release:      0york1~22.04
Release-Tags:  relext
License:       CDDL
Author:        OpenZFS
Linux-Maximum: 6.0
Linux-Minimum: 3.10

this is what happens if I try to build the DKMS module for zfs 2.1.6 :

dkms install zfs/2.1.6
Sign command: /usr/lib/linux-kbuild-6.0.0-6/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Binary kmod-sign not found, modules won't be signed
Error! Could not locate dkms.conf file.
File: /var/lib/dkms/zfs/2.1.6/source/dkms.conf does not exist.

Marietto2008 avatar Oct 31 '22 12:10 Marietto2008

On a Fedora 36 machine, with the 2.1.6 sources installed to /usr/src/zfs-2.1.6/ through dnf download --source zfs and rpm -ivh zfs-2.1.6-1.fc36.src.rpm, the build succeeded on their recent Linux 6 kernel with patching META to 6 and installing the DKMS module manually:

@almereyda I think you don't need to patch META. Today I installed 6.0.5-200.fc36.x86_64 on my main rig (also Fedora 36) just by doing a bog-standard update with sudo dnf upgrade and zfs got built without any issues, just like with previous 5.19 kernel releases. (Not yet rebooted into the newer kernel, so not tested yet)

$ cat /usr/src/zfs-2.1.6/META 
Meta:          1
Name:          zfs
Branch:        1.0
Version:       2.1.6
Release:      1
Release-Tags:  relext
License:       CDDL
Author:        OpenZFS
Linux-Maximum: 5.19
Linux-Minimum: 3.10
$ dkms status
zfs/2.1.6, 5.19.16-200.fc36.x86_64, x86_64: installed
zfs/2.1.6, 6.0.5-200.fc36.x86_64, x86_64: installed

bit2shift avatar Oct 31 '22 19:10 bit2shift

Yes. It worked for Ubuntu 22.04 (running on top of kernel 5.19.0-16.4-liquorix and kernel 6.0.0-6.1-liquorix). I issued the apt install zfs-dkms command when I was running Ubuntu 22.04 + kernel 5.19.0-16.4-liquorix and it compiled the ZFS module for both the kernel versions. It does not work on Ubuntu 22.10,neither with kernel 5.19.0-16.4-liquorix,nor on top of kernel 6.0.0-6.1-liquorix. Probably I've messed up the configuration files and now it is broken. Or maybe zfs-dkms is not compatible,for some reasons,with Ubuntu 22.10.

Il lun 31 ott 2022, 20:35 Danilo Margarido @.***> ha scritto:

On a Fedora 36 machine, with the 2.1.6 sources installed to /usr/src/zfs-2.1.6/ through dnf download --source zfs and rpm -ivh zfs-2.1.6-1.fc36.src.rpm, the build succeeded on their recent Linux 6 kernel with patching META to 6 and installing the DKMS module manually:

@almereyda https://github.com/almereyda I think you don't need to patch META. Today I installed 6.0.5-200.fc36.x86_64 on my main rig (also Fedora 36) just by doing a bog-standard update with sudo dnf upgrade and zfs got built without any issues, just like with previous 5.19 kernel releases. (Not yet rebooted into the newer kernel, so not tested yet)

$ cat /usr/src/zfs-2.1.6/META Meta: 1 Name: zfs Branch: 1.0 Version: 2.1.6 Release: 1 Release-Tags: relext License: CDDL Author: OpenZFS Linux-Maximum: 5.19 Linux-Minimum: 3.10 $ dkms status zfs/2.1.6, 5.19.16-200.fc36.x86_64, x86_64: installed zfs/2.1.6, 6.0.5-200.fc36.x86_64, x86_64: installed

— Reply to this email directly, view it on GitHub https://github.com/openzfs/zfs/issues/14024#issuecomment-1297576460, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFYNCZAITTF2PUHV4K25TDWGANQTANCNFSM6AAAAAARDSYPAI . You are receiving this because you commented.Message ID: @.***>

Marietto2008 avatar Oct 31 '22 19:10 Marietto2008

Reporting back from a rebooted F36 machine, that has the DKMS module built, there was an incident with a tainted Kernel after resuming from standby.

Please see this ABRT (link valid for 7 days):

  • https://lake.ecobytes.net/uploads/2022-11-04.abrt.zfs.zst?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ecobytes%2F20221104%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20221104T134854Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=2f3489b7d9d69797b3a50a359ba2c68d6c7b981caf52e1310b3e47b5af0220b2

almereyda avatar Nov 04 '22 13:11 almereyda

@Marietto2008 OpenZFS sources are incorrectly installed in your case.

Please try fetching sources from git (the master branch), build deb-dkms source package and install it. dkms will compile the kernel module correctly.

./autogen.sh
./configure --prefix=/usr --with-config=srpm
make -j8 deb-dkms
sudo dpkg -i zfs-dkms*.deb
sudo dkms install -m zfs/2.1.99 -k 6.0.0-7.1-liquorix-amd64

Results:

config.status: executing libtool commands
config.status: executing po-directories commands

Building module:
Cleaning build area...
make -j4 KERNELRELEASE=6.0.0-7.1-liquorix-amd64........................................

Running the post_build script:
Cleaning build area...

zfs.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.0.0-7.1-liquorix-amd64/updates/dkms/

spl.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.0.0-7.1-liquorix-amd64/updates/dkms/
depmod...

szubersk avatar Nov 06 '22 10:11 szubersk

There is an issue with linux-6.1

In /usr/src/linux-headers-6.1.0-0-common/include/linux/memory_hotplug.h this function was added:

static inline void pgdat_kswapd_lock_init(pg_data_t *pgdat) { mutex_init(&pgdat->kswapd_lock); }

It clashes with: /var/lib/dkms/zfs/2.1.6/build/include/os/linux/spl/sys/mutex.h:99: 99 | #define mutex_init(mp, name, type, ibc)

GerMalaz avatar Nov 06 '22 15:11 GerMalaz

There is an issue with linux-6.1

In /usr/src/linux-headers-6.1.0-0-common/include/linux/memory_hotplug.h this function was added:

static inline void pgdat_kswapd_lock_init(pg_data_t *pgdat) { mutex_init(&pgdat->kswapd_lock); }

It clashes with: /var/lib/dkms/zfs/2.1.6/build/include/os/linux/spl/sys/mutex.h:99: 99 | #define mutex_init(mp, name, type, ibc)

Please confirm which commit you built at, as https://github.com/openzfs/zfs/commit/212ba9bd97222613fe17bd8f0cc3e957e7f5d29b should fix that. Note that 2.1.6 won't work, you need to build from 2.1.7-staging.

thesamesam avatar Nov 07 '22 05:11 thesamesam

  • #14162

is now here and on a good run to being completed fairly soon.

almereyda avatar Nov 22 '22 23:11 almereyda

This has long been implemented.

almereyda avatar Sep 01 '23 18:09 almereyda