Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux 6.7 super_block has s_shrink failing #15518

Closed
ptr1337 opened this issue Nov 13, 2023 · 33 comments
Closed

Linux 6.7 super_block has s_shrink failing #15518

ptr1337 opened this issue Nov 13, 2023 · 33 comments
Labels
Type: Building Indicates an issue related to building binaries Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@ptr1337
Copy link

ptr1337 commented Nov 13, 2023

Kernel: 6.7 rc1
Operating System: CachyOS (Archlinux)

Relevant Log:

checking whether sops->dirty_inode() wants flags... yes
checking whether super_block has s_shrink... configure: error: 
        *** None of the expected "sb->s_shrink()" 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.2.99-174_g043c6ee3b
        *** Compatible Kernels: 3.10 - 6.5
@ptr1337 ptr1337 added the Type: Defect Incorrect behavior (e.g. crash, hang) label Nov 13, 2023
@satmandu
Copy link
Contributor

This might be due to the lockless slab shrink work?

e.g. https://lore.kernel.org/linux-erofs/[email protected]/
https://lwn.net/Articles/940644/

@ascendbeing
Copy link

I believe it can be narrowed down to this commit: torvalds/linux@ecae0bd
it looks like they changed the s_shrink format in this commit to something zfs does not currently anticipate.
so maybe try building against the commit just prior to this one, or maybe someone can do a patch/PR
I was looking at https://github.com/torvalds/linux/commits/master/include/linux/fs.h to find this.

@behlendorf behlendorf added the Type: Building Indicates an issue related to building binaries label Nov 17, 2023
@ckane
Copy link
Contributor

ckane commented Nov 19, 2023

Thanks for all the details, I saw this too on my Arch system when trying to build the new kernel, but haven't had a chance to dig in.

@spikerguy
Copy link

Any update on this ?

I tried to build on aarch64 with upstream kernel 6.7-rc3 and failed with same error.

Thanks.

@setar
Copy link

setar commented Dec 14, 2023

arm64 , kernel 6.7-rc5 same error.
I can't downgrade the kernel version as it doesn't have dev board orange5+ support.
And now ZFS not work on this platform...

@robn robn mentioned this issue Dec 16, 2023
13 tasks
@DominoTree
Copy link

DominoTree commented Feb 6, 2024

Just hit this with a regular Fedora update (building via DKMS/akmods) - I suspect others will be hitting it soon as well

@satmandu
Copy link
Contributor

satmandu commented Feb 6, 2024

Wait for OpenZFS 2.2.3 to come out...

@gpmidi
Copy link

gpmidi commented Feb 7, 2024

For the Fedora 39 users out there that need to roll back the kernel to get around this...

dnf install kernel-\*-6.5.6
dnf (re)install zfs zfs-dkms

@DominoTree
Copy link

DominoTree commented Feb 7, 2024

For the Fedora 39 users out there that need to roll back the kernel to get around this...

dnf install kernel-\*-6.5.6
dnf (re)install zfs zfs-dkms

On F39, I did the following to get a list of installed kernels (I believe Fedora keeps the most recent 3) and switch back to an existing one prior to 6.7.x (6.6.14 happened to be the most recent)

I think the next kernel update will automatically go back to being the default, but I'm gonna keep an eye on it.

grubby --info=ALL
grubby --set-default=/boot/vmlinuz-6.6.14-200.fc39.x86_64

More info is here: https://www.golinuxcloud.com/grubby-command-examples/#6_List_installed_kernels

@edgan
Copy link

edgan commented Feb 10, 2024

I took the 6.7 commits from this PR, #15860, and with a little tweaking made a usable patch for ZFS 2.2.2 and 6.7.x Linux kernels. I have successfully used it to compile modules for 6.7.3 and 6.7.4. I am currently running it with 6.7.4 on Fedora 39.

Use at your own risk.

Steps:

cd /usr/src
wget https://cygnusx-1.org/zfs-2.2.2-6.7.patch
cd zfs-2.2.2
cat ../zfs-2.2.2-6.7.patch | patch -p1
dkms build -m zfs -v 2.2.2 -k 6.7.3-200.fc39.x86_64
dkms install -m zfs -v 2.2.2 -k 6.7.3-200.fc39.x86_64

@tleydxdy
Copy link

I wonder why can't the zfs fedora package block the newer kernels... should the dep for zfs be kernel-devel-matched instead of kernel-devel since kernel-devel doesn't depend on the kernel?

$ dnf repoquery --requires zfs-dkms
Last metadata expiration check: 4:57:37 ago on Mon 12 Feb 2024 11:48:19 PM CST.
/bin/sh
diffutils
dkms >= 2.2.0.3
gcc
kernel-devel <= 6.6.999
kernel-devel >= 3.10
make
perl

@gpmidi
Copy link

gpmidi commented Feb 12, 2024

@tleydxdy The older one is probably installed to meet deps; no guarantee about which runs though.

@tleydxdy
Copy link

right I mean it should block 6.7 since that is not in even in the supported range.

@AllKind
Copy link
Contributor

AllKind commented Feb 12, 2024

echo 'zfs' > /etc/dnf/protected.d/zfs.conf
does the trick

@DominoTree
Copy link

DominoTree commented Feb 12, 2024

echo 'zfs' > /etc/dnf/protected.d/zfs.conf does the trick

This file will prevent DNF from uninstalling ZFS while doing other updates, but won't prevent DNF from upgrading to a kernel that makes the DKMS module fail to build - ask me how I know :P

I believe this is also a default part of the ZFS installation on Fedora.

DNF is only aware of the zfs-dkms metapackage being installed, and not whether the dkms code will actually build properly on the next boot via akmods with whatever kernel Grub is pointed at when that happens - lots of moving parts to deal with.

@tleydxdy
Copy link

exactly, the zfs packages should block kernels with unsupported major version from even installing, it still might break for minor version updates I suppose but it's a lot better than nothing

@YesThatGy
Copy link

Fedora 39 user here. Ran into this a few weeks ago, did an update and still not fixed.

"the zfs packages should block kernels with unsupported major version from even installing"

Can I +100 vote for this?

@DominoTree
Copy link

DominoTree commented Feb 20, 2024 via email

@tleydxdy
Copy link

I think that is a bit overkill, at the most basic, say zfs-2.2.2 is released with "Linux: compatible with 3.10 - 6.6 kernels" then the package can simply be mark as incompatible with kernel <=3.8 and kernel >=6.7

@DominoTree
Copy link

DominoTree commented Feb 21, 2024 via email

@AllKind
Copy link
Contributor

AllKind commented Feb 21, 2024

dkms does not provide any mechanism to talk to each possible packet manager out there (AFAIK).
If a distro is packaging the zfs-dkms or kmods it is responsible for configuring the relevant 'Conflict' or whatever definitions for their package (.deb or .rpm for example).
Now the packages built from source by OpenZFS would need to identify each distribution (i.e. fedora, ubuntu, etc), most likely in the ./configure process and pass that information to the package building scripts (for i.e. .deb or .rpm) and there depending on which distro is in play define the 'Conflict' with the correct package name for that distribution (i.e. linux-source, kernel-source, kernel-devel, etc.)
See my comment: #15759 (comment)
Nobody has done the work (yet).
I bet the OpenZFS developers would more then welcome a Pull Request from somebody volunteering for that.

@robn
Copy link
Member

robn commented Feb 23, 2024

FYI, 2.2.3 is released: https://github.com/openzfs/zfs/releases/tag/zfs-2.2.3

@DominoTree
Copy link

DominoTree commented Feb 23, 2024 via email

@AllKind
Copy link
Contributor

AllKind commented Feb 24, 2024

@DominoTree
Maybe this will come in handy: https://fedoraproject.org/wiki/Packaging:Conflicts

@AllKind
Copy link
Contributor

AllKind commented Feb 28, 2024

@DominoTree
I didn't notice it before, but looked at the zfs-dkms.spec.in file now and I see the min/max version and a requires definition are already there:

Requires:       kernel-devel >= @ZFS_META_KVER_MIN@, kernel-devel <= @[email protected]
Requires(post): kernel-devel >= @ZFS_META_KVER_MIN@, kernel-devel <= @[email protected]

So either that is not sufficient for RPM (Do we need a Conflicts definition?), or something else in the chain is broken??

@ptr1337
Copy link
Author

ptr1337 commented Feb 28, 2024

Ill close this bug, since it is fixed in upstream.

@ptr1337 ptr1337 closed this as completed Feb 28, 2024
@tleydxdy
Copy link

@AllKind @ptr1337 yes, require is not enough, need to have conflict as well. that line is already there but me and a few others still get broken system from kernel upgrades. also kernel-devel is different from kernel, it's only the headers

@ptr1337
Copy link
Author

ptr1337 commented Feb 29, 2024

@AllKind @ptr1337 yes, require is not enough, need to have conflict as well. that line is already there but me and a few others still get broken system from kernel upgrades. also kernel-devel is different from kernel, it's only the headers

I think this should be in a separate issue discussed since this is not a direct issue with the current 6.7 issue described above.

@poige
Copy link

poige commented Mar 8, 2024

Ill close this bug, since it is fixed in upstream.

@ptr1337 That's ambiguous — which upstream(?), if there're 2 involved projects (kernel and ZFS).

References would be handy.

checking whether super_block has s_shrink... configure: error:
        *** None of the expected "sb->s_shrink()" interfaces were detected.
[…skip…]
        *** ZFS Version: zfs-2.2.3-1
        *** Compatible Kernels: 3.10 - 6.7

— I'm facing this very issue with zfs-2.2.3-1 and 6.7.9

@AllKind
Copy link
Contributor

AllKind commented Mar 8, 2024

@poige
ptr1337 meant ZFS upstream. Namely by this pull request: #15694
If it fails for you with kernel 6.7, you should open a new issue providing the details of your setup.
You should also provide your config.log.

@robn
Copy link
Member

robn commented Mar 8, 2024

2.2.3 builds fine here against 6.7.9. More information required. I suggest opening a new issue; this one is closed and no one is watching it closely.

@poige
Copy link

poige commented Mar 8, 2024

Thanks for info both @robn and
@AllKind … as to what I should do — I'm sure everybody should mind theirs own business and avoid telling people what they should do. ;-P

@AllKind
Copy link
Contributor

AllKind commented Mar 8, 2024

@poige

as to what I should do — I'm sure everybody should mind theirs own business and avoid telling people what they should do. ;-P

WTF?
I was only trying to be of assistance. As robn said, this is a closed thread. Doesn't get much attention.
I didn't say you must do this, or that. I was only advising what would be most helpful to you and the developers in order to help you!
How that could be interpreted as patronizing is beyond me.
If I would mind my own business, I wouldn't try to help you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Building Indicates an issue related to building binaries Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

Successfully merging a pull request may close this issue.