Open IvanVolosyuk opened 10 hours ago
I bisected the kernel commit where the issue starts to occur:
This is the commit when it stopped allow the sentinels. Instead I think you could dig deeper to find when they become optional, since that is where the KPI has changed, and I wonder if it was more documented back then. The later was just a compatibility window.
Kernel versions aren't reliable, stuff can be backported to older kernels (RHEL kernels are known for that), testing a kernel version within OpenZFS code to make a decision of which code to use is thus not a good idea. It always needs a specific configure test, which affects zfs_config.h
, which is what you can then use in the source to disambiguate between the different variants.
(I don't speak m4 either, I always just go looking for something in the config/
dir that is the closest to what I'm trying to do and then just copy and modify it)
Fixes openzfs kernel module loading on 6.11+ with CONFIG_RANDSTRUCT=y
Motivation and Context
This change fixes #16620 Linux kernel after 6.1-rc1 stopped using proc sentinel records and relies on ARRAY_SIZE. ZFS still uses the sentinel values, which causes crash:
I bisected the kernel commit where the issue starts to occur: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d7a76ec87195ced6910b0ca10ca133bb316c90f5
Description
The fix is to guard proc sentinel values using kernel version. Ideally it should be more targeted, but I don't know how to do that and if it even possible.
How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.