-
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 6.8 compat #15805
Linux 6.8 compat #15805
Conversation
@behlendorf if it suits you, I will leave this in draft and keep updating it until near or at 6.8.0 release. |
@youzhongyang Hi! You did the |
I roughly looked at the changes in Linux kernel, and this PR, more need to be done for idmap to work. I will come back later with more details. |
I just tried building with this patch and I am still getting errors RPM build warnings: RPM build errors: Any idea? |
@greg-hydrogen yeah, this happened in some of the CI tests, but I couldn't make it happen locally. Could you post your |
@robn - Here you go! thanks for taking a look |
3526414
to
6e589ec
Compare
@greg-hydrogen thanks. Turns out I'd got my strlcpy/strscpy tests wrong. Not so wrong that they made a difference, but wrong enough that compiling with |
odd.. still not working for me, this is new though |
@greg-hydrogen looks like it might be a bug in rc1, see https://www.spinics.net/lists/kernel/msg5058863.html. Not sure which config option causes it though. I'll wait to see what upstream does. Hopefully they revert it for rc2. |
Here is the change that can make idmap work in kernel 6.8:
|
Tested the changes under the following 2 kernels:
Both "zfs-tests.sh -v -T user_namespace" and "zfs-tests.sh -v -T idmap_mount" passed. |
One more improvement: The following line in the above
can be changed to
as when HAVE_IDMAP_NO_USERNS is defined, HAVE_IOPS_CREATE_IDMAP is also defined. |
For your convenience, the following commit can be cherry-picked: It has been tested in kernel 6.7 and 6.8 by running tests in 'user_namespace' and 'idmap_mount'. |
do you mind providing your kernel .config file so I see why mine is failing and try to build against a working config |
I simply edited META file so build can pass. |
That works for me. |
@youzhongyang I've merged your suggestion and tested it on multiple kernels, all tests pass. Thank you very much! If you'd like changes to the comment or how I've credited you, please let me know! |
Since the merge window is closed (rc1 is out), further API changes are much less likely. What about merging it now, and cherrypicking into the (hopefully-soon-to-be-released) 2.2.3, so when it's released we have certain compatibility with kernel 6.7 and high likelyhood of compatibility with 6.8 (at user's risk) as soon as it's released? (to be clear: i do not suggest updating -META for 6.8 until after the release) |
The comment looks good to me. Speaking of credits in the final commit, I am not sure how it is handled in openzfs, I remember there is something called 'Co-Authored-By'. |
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.
Looks good, just one small nit. As @maxximino said since rc1 is out breaking changes are much less likely so I'm fine pulling this in to master to soak. Assuming everything holds up well we can also look in to backporting them potentially for 2.2.3.
The kernel is now being compiled with -Wmissing-prototypes. Most of our test stub functions had no prototype, and failed to compile. Since they don't need to be visible anywhere else, just make them all static. Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/
blkdev_get_by_path() and blkdev_put() have been replaced by bdev_open_by_path() and bdev_release(), which return a "handle" object with the bdev object itself inside. This adds detection for the new functions, and macros to handle the old and new forms consistently. Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/
Linux has removed strlcpy in favour of strscpy. This implements a fallback implementation of strlcpy for this case. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805 (cherry picked from commit 7466e09)
MAX_ORDER has been renamed to MAX_PAGE_ORDER. Rather than just redefining it, instead define our own name and set it consistently from the start. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805 (cherry picked from commit 09e6724)
The kernel is now being compiled with -Wmissing-prototypes. Most of our test stub functions had no prototype, and failed to compile. Since they don't need to be visible anywhere else, just make them all static. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes #15805 (cherry picked from commit 64afc4e)
blkdev_get_by_path() and blkdev_put() have been replaced by bdev_open_by_path() and bdev_release(), which return a "handle" object with the bdev object itself inside. This adds detection for the new functions, and macros to handle the old and new forms consistently. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes #15805 (cherry picked from commit ce782d0)
Linux has removed strlcpy in favour of strscpy. This implements a fallback implementation of strlcpy for this case. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes #15805 (cherry picked from commit 7466e09)
MAX_ORDER has been renamed to MAX_PAGE_ORDER. Rather than just redefining it, instead define our own name and set it consistently from the start. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes #15805 (cherry picked from commit 09e6724)
The kernel is now being compiled with -Wmissing-prototypes. Most of our test stub functions had no prototype, and failed to compile. Since they don't need to be visible anywhere else, just make them all static. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
blkdev_get_by_path() and blkdev_put() have been replaced by bdev_open_by_path() and bdev_release(), which return a "handle" object with the bdev object itself inside. This adds detection for the new functions, and macros to handle the old and new forms consistently. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
Linux has removed strlcpy in favour of strscpy. This implements a fallback implementation of strlcpy for this case. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
MAX_ORDER has been renamed to MAX_PAGE_ORDER. Rather than just redefining it, instead define our own name and set it consistently from the start. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
The name inode_permission is now defined in the kernel. Rename ours to test_permission, in line with most of our other tests. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
struct mnt_idmap no longer has a struct user_namespace within it. Work around this by creating a temporary with the copy of the map we need taken from the idmap. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Youzhong Yang <yyang@mathworks.com> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
The kernel is now being compiled with -Wmissing-prototypes. Most of our test stub functions had no prototype, and failed to compile. Since they don't need to be visible anywhere else, just make them all static. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
blkdev_get_by_path() and blkdev_put() have been replaced by bdev_open_by_path() and bdev_release(), which return a "handle" object with the bdev object itself inside. This adds detection for the new functions, and macros to handle the old and new forms consistently. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
Linux has removed strlcpy in favour of strscpy. This implements a fallback implementation of strlcpy for this case. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
MAX_ORDER has been renamed to MAX_PAGE_ORDER. Rather than just redefining it, instead define our own name and set it consistently from the start. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
The name inode_permission is now defined in the kernel. Rename ours to test_permission, in line with most of our other tests. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
struct mnt_idmap no longer has a struct user_namespace within it. Work around this by creating a temporary with the copy of the map we need taken from the idmap. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Youzhong Yang <yyang@mathworks.com> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
The kernel is now being compiled with -Wmissing-prototypes. Most of our test stub functions had no prototype, and failed to compile. Since they don't need to be visible anywhere else, just make them all static. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
blkdev_get_by_path() and blkdev_put() have been replaced by bdev_open_by_path() and bdev_release(), which return a "handle" object with the bdev object itself inside. This adds detection for the new functions, and macros to handle the old and new forms consistently. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
Linux has removed strlcpy in favour of strscpy. This implements a fallback implementation of strlcpy for this case. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
MAX_ORDER has been renamed to MAX_PAGE_ORDER. Rather than just redefining it, instead define our own name and set it consistently from the start. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
The name inode_permission is now defined in the kernel. Rename ours to test_permission, in line with most of our other tests. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
struct mnt_idmap no longer has a struct user_namespace within it. Work around this by creating a temporary with the copy of the map we need taken from the idmap. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Youzhong Yang <yyang@mathworks.com> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15805
This is closed, but the latest releases say they only support up to 6.7 Does ZFS 2.2.x support the 6.8 kernel or not ? |
@tomchiverton: looking at the commit log in the 2.2.4 staging branch (https://github.com/openzfs/zfs/tree/zfs-2.2.4-staging), it looks like 2.2.4 should work on Kernel 6.8 when it is released, I believe. I just cloned it and did a test build against Linux 6.8.4 and it seems to work fine. |
Is that likely to be soon, before all the Fedora (etc) users have issues again, like with 6.7?
--
†øღ
Sent from a super computer that fits in my pocket and is connected to the sum total of all human knowledge
…On 10 April 2024 23:31:53 BST, Coleman Kane ***@***.***> wrote:
> This is closed, but the latest releases say they only support up to 6.7
>
> Does ZFS 2.2.x support the 6.8 kernel or not ?
@tomchiverton: looking at the commit log in the 2.2.4 staging branch (https://github.com/openzfs/zfs/tree/zfs-2.2.4-staging), it looks like 2.2.4 should work on Kernel 6.8 when it is released, I believe. I just cloned it and did a test build against Linux 6.8.4 and it seems to work fine.
--
Reply to this email directly or view it on GitHub:
#15805 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
I believe this is already and issue for Fedora 39 it has been 6.8.x for the past two weeks. I had to rpmrebuild zfs-dkms to edit the 6.7.999 max version. |
@derekschrock I saw that with Fedora 39 as well. The upcoming 2.2.4 release will support the 6.8 kernel: #16107. |
Motivation and Context
Linux 6.8 release candidates are starting to appear, with the usual mixed bag of API changes. This PR makes the adjustments required on our side.
Closes #15803
Description
See individual commits. Summary:
-Werror -Wmissing-prototypes
block_device
acquire/release functionsstrlcpy()
fallbackMAX_ORDER
renameinode_operations..permission
testsmnt_idmap
anduser_namespace
decouplingThis gets things working up to 6.8-rc1.
How Has This Been Tested?
Compiled and light sanity check run (create pool, short fio read/write cycle, export, import, scrub) against kernel versions:
Seems not totally wrong at least.
Types of changes
Checklist:
Signed-off-by
.