-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support idmapped mount for kernel 6.3 #14682
Conversation
6.3-rc4 test results:
|
My dmesg log is aglow with a flood of:
|
Thanks for testing. This is what I got when creating a zpool using virtual disks:
This traces down to the line of code in blk-core.c: https://github.com/torvalds/linux/blob/master/block/blk-core.c#L756 This seems to be a kernel block driver behavior change. |
The commit "block: add a sanity check for non-write flush/fua bios" introduced the change. I patched bio_set_flush() and tested again, it's now all clear. I am not sure if this is the right approach, need to think about how we should tackle this issue.
|
@youzhongyang thanks for sorting out both of these 6.3 issues. I'll work on getting this reviewed. |
Signed-off-by: Youzhong Yang <yyang@mathworks.com>
This PR has been updated and rebased. The writepage_t change is now gone from the PR. |
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.
Thanks for sorting this out by adding all the needed compatibility code. Everything here looks good, the CI passes, and I see the change is mostly mechanical. I'll get this merged right away.
With this PR merged I was able to build a module for 6.3-rc6. But then booting I get this error:
Happy to open an issue for this if that would be helpful. |
Linux kernel 6.3 changed a bunch of APIs to use the dedicated idmap type for mounts (struct mnt_idmap), we need to detect these changes and make zfs work with the new APIs. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes openzfs#14682
Linux kernel 6.3 changed a bunch of APIs to use the dedicated idmap type for mounts (struct mnt_idmap), we need to detect these changes and make zfs work with the new APIs. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes openzfs#14682
I've seen this too:
I don't see why the dn_bonus can't be 3904 bytes. How could it assume it's only 320 bytes (uint8_t dn_bonus[DN_OLD_MAX_BONUSLEN] where DN_OLD_MAX_BONUSLEN=320)? This looks more or less a bug in include/linux/fortify-string.h. We should think about how we can make it happy. |
Linux kernel 6.3 changed a bunch of APIs to use the dedicated idmap type for mounts (struct mnt_idmap), we need to detect these changes and make zfs work with the new APIs. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes openzfs#14682
Linux kernel 6.3 changed a bunch of APIs to use the dedicated idmap type for mounts (struct mnt_idmap), we need to detect these changes and make zfs work with the new APIs. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes openzfs#14682
Thanks for adding support for this. Is any backport to 2.1 planned, resp. is 2.2 planned for near future, or should we switch to master for now ? I know the correct approach would be to stick to an LTS kernel for now :-) |
Also never to use ZFS with bleeding edge hardware. Mainly never buying hardware less than 5 years old. |
Linux kernel 6.3 changed a bunch of APIs to use the dedicated idmap type for mounts (struct mnt_idmap), we need to detect these changes and make zfs work with the new APIs. NOTE: This backport only includes the configure checks to detect the 6.3 idmap API changes. It does not include support for idmap. When provided the idmap variable is ignored in most case in the same way the user_ns argument was ignored. This change is solely to provide compatibility with the new interfaces. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes openzfs#14682
Linux kernel 6.3 changed a bunch of APIs to use the dedicated idmap type for mounts (struct mnt_idmap), we need to detect these changes and make zfs work with the new APIs. NOTE: This backport only includes the configure checks to detect the 6.3 idmap API changes. It does not include support for idmap. When provided the idmap variable is ignored in most case in the same way the user_ns argument was ignored. This change is solely to provide compatibility with the new interfaces. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes openzfs#14682
Linux kernel 6.3 changed a bunch of APIs to use the dedicated idmap type for mounts (struct mnt_idmap), we need to detect these changes and make zfs work with the new APIs. NOTE: This backport only includes the configure checks to detect the 6.3 idmap API changes. It does not include support for idmap. When provided the idmap variable is ignored in most case in the same way the user_ns argument was ignored. This change is solely to provide compatibility with the new interfaces. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes #14682
This PR adds changes needed for idmapped mount support in kernel 6.3.
Signed-off-by: Youzhong Yang yyang@mathworks.com
Motivation and Context
Linux kernel 6.3 changed a bunch of APIs to use the dedicated idmap type for mounts (struct mnt_idmap), we need to detect these changes and make zfs work with the new APIs.
Description
The new struct mnt_idmap is hidden and those essential APIs such as make_vfsuid, make_vfsgid, from_vfsuid, and from_vfsgid are defined as GPL only. We have to work around this.
The approach is to redefine struct mnt_idmap in the same way as it is in kernel 6.3. In the future if its definition is changed, our test cases should be able to catch it.
How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.