Wandering Thoughts archives

2022-03-03

Understanding a thing with ZFS on Linux, kernel versions, RPMs, and DKMS

I use ZFS on Linux on my office and home Fedora desktops. It's installed with RPM packages using the 'zfs-dkms' option, where the ZoL RPMs install a DKMS module that DKMS then builds for whatever kernels. The advantage of the DKMS approach is that I don't need to somehow pre-build new kernel module RPMs before I upgrade my kernel; instead DKMS rebuilds things automatically. Recently I went to install a Fedora kernel upgrade to 5.16.11 and as part of the upgrade DNF said it was going to remove the 'zfs' and 'zfs-dkms' RPMs as incompatible. Of course I said no to that, and when I looked at the 'META' source file that controls kernel version compatibility (among other things) I saw that ZoL currently only supports up to 5.15.

Obviously, I thought, DNF had detected that the ZFS RPMs didn't support 5.16 and so moving from 5.15 to 5.16 would require removing them. Today I actually looked into this and it turns out that I was quite wrong and there is a rather different explanation that exposes a somewhat alarming situation that I'll have to pay attention to in the future.

I was correct that the ZFS RPMs declared that they weren't compatible with 5.16 and later kernels. However, I was incorrect about why DNF wanted to remove them. DNF didn't want to remove them because I was installing my first 5.16 kernel; it wanted to remove them because as part of installing another new kernel package, it would be removing the last 5.15 kernel I had installed. The ZFS RPM dependencies on a kernel version below 5.16 were satisfied as long as I had one such kernel installed, regardless of what kernel I was actually using.

This means that I had already been running ZFS on Linux on a series of 5.16 kernels for weeks and weeks, despite it not being marked as compatible with them. The kernel modules had compiled (using the latest development version of ZoL every time I installed a new kernel) and nothing seems to have gone wrong, which is good and why I hadn't noticed before now. There is a way to tell DKMS that a DKMS module is incompatible with some kernel versions in its dkms.conf file (documented in the dkms manual page, but it's not straightforward to use and ZoL doesn't set it.

Since Fedora is usually a bit behind the bleeding edge of kernel development and I do keep up with the bleeding edge of ZFS on Linux, I usually assume that I won't run into any sort of kernel version compatibility problems. And in fact I probably haven't run into one now; the development version of ZoL may well be already fully compatible with 5.16, and just hasn't been marked that way. And the development tree is already working on changes for compatibility with the as yet unreleased 5.17 kernel (eg 1, 2, 3, all of which landed shortly after the first 5.17 release candidate came out).

(The ZoL kernel module always compiled, but compiling and appearing to work doesn't necessarily mean that there are no lingering compatibility issues.)

linux/ZFSOnLinuxKernelVersAndRPM written at 22:06:37; Add Comment


Page tools: See As Normal.
Search:
Login: Password:
Atom Syndication: Recent Pages, Recent Comments.

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.