-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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: Fix openzfs kernel module loading on 6.11+ with CONFIG_RANDSTRUCT=y #16805
Conversation
9d832f5
to
02e8080
Compare
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 (I don't speak m4 either, I always just go looking for something in the |
btw how about, instead of ifdefing everywhere, define a macro that will either fill in the optional guard or nothing? something like
and then just place |
Thank you, guys, for the feedback. I dig a bit more into this and made a facepalm. It turns out @robn already did what I was trying to do in a more elegant way: The real problem to be solved is: why CONFG_RANDSTRUCT breaks the detection of register_sysctl_sz() in config/kernel-register_sysctl_table.m4 |
02e8080
to
fbff532
Compare
I have updated the commit and pull request description. It ended up being just a one-liner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it works, then it works for me. Good stuff!
Do you happen to have the output from the failing register_sysctl_sz
test? And which compiler you're using? I'm curious about how it failed, that this could fix it. I'm suspecting a version of #16206.
Sure, @robn
|
Oh right, much dumber than I thought. The |
3b6cb94
to
de8bafc
Compare
Damn, I accidentally pushed 'Update branch' button and it created a merge commit to master on top of my changes. To get rid of this I just force pushed to go back to a good old state. So, should I just wait now for merge or I have to do something? e.g. manually rebase on top current master? That's my first commit for openzfs. |
@IvanVolosyuk If your master was reasonably recent, that should be fine. Sure the newer the better, but within reason, to not over-stress CI with extra testing. Once all the CI tests complete successfully and there are enough qualified positive reviews, it will be merged. |
zloop run was successful before I rebased: https://github.com/openzfs/zfs/actions/runs/12028052804 |
@IvanVolosyuk Unfortunately it is too random and so unstable in its results. It is not necessary that the reports are wrong, just likely not related to this PR. It is not a blocker here. |
@IvanVolosyuk It seems github stuck in "Checking for ability to merge automatically…". I can't merge it. Could you rebase and force-push it? |
Adjust the m4 function to mimic sentinel we use in spl-proc.c This fixes the detection on kernels compiled with CONFIG_RANDSTRUCT=y Closes: 16620 Signed-off-by: Ivan Volosyuk <Ivan.Volosyuk@gmail.com>
fbff532
to
02912d1
Compare
Done, should be good now. |
Adjust the m4 function to mimic sentinel we use in spl-proc.c This fixes the detection on kernels compiled with CONFIG_RANDSTRUCT=y Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Rob Norris <robn@despairlabs.com> Reviewed-by: Pavel Snajdr <snajpa@snajpa.net> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Ivan Volosyuk <Ivan.Volosyuk@gmail.com> Closes: openzfs#16620 Closes: openzfs#16805
Adjust the m4 function to mimic sentinel we use in spl-proc.c This fixes the detection on kernels compiled with CONFIG_RANDSTRUCT=y Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Rob Norris <robn@despairlabs.com> Reviewed-by: Pavel Snajdr <snajpa@snajpa.net> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Ivan Volosyuk <Ivan.Volosyuk@gmail.com> Closes: openzfs#16620 Closes: openzfs#16805
On NixOS despite including this patch I still get the same boot error on the hardened 6.11 kernel. Anyone else been looking into this and found a solution / workaround? |
@cawilliamson
|
Did you run ./autogen.sh after applying the patch? The change is only used when run ./autogen.sh before ./configure as it changes the configure script itself. |
@IvanVolosyuk The issue is now open at: #16849 (closed pull requests don't get much attention...) |
Fixes openzfs kernel module loading on 6.11+ with CONFIG_RANDSTRUCT=y
Motivation and Context
This change fixes #16620
It looks like detection logic for register_sysctl_sz() in kernel-register_sysctl_table.m4 doesn't quite work with
CONFIG_RANDSTRUCT=y
. It causes the same issue as before the original fix in 2633075#diff-cc1bb9d36ff95af7e87e3c4a8fc022ea302ecfdccbc9fa1e9663c9c7b51dc416R722Description
The fix is to replace {0} with {{}} in the m4 script, which better matches the sentinels we use in spl-proc.c
How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.