-
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 5.12 compat: inode_owner_or_capable() #11699
Conversation
The inode_owner_or_capable() function was updated in the 5.12 kernel to support idmapped mounts. As part of this change the user namespace is now passed as the first argument. For non-idmapped mounts, which are currently not supported, the initial user namespace may be passed which will result in identical behavior as before. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
I think we have more work to do for 5.12, just tried this patch with 5.12-rc2 and I get:
|
@rkitover correct, I've converted the PR to a WIP until we can resolve the additional xattr changes. |
So I pulled this into my tree, and it appears that the
|
Looks like the following definition was changed from 7-args to 8-args, with the int (*set)(const struct xattr_handler *,
struct user_namespace *mnt_userns, struct dentry *dentry,
struct inode *inode, const char *name, const void *buffer,
size_t size, int flags); The same modification didn't happen to |
Change was introduced in kernel commit +/**
+ * posix_acl_chmod - chmod a posix acl
+ *
+ * @mnt_userns: user namespace of the mount @inode was found from
+ * @inode: inode to check permissions on
+ * @mode: the new mode of @inode
+ *
+ * If the inode has been found through an idmapped mount the user namespace of
+ * the vfsmount must be passed through @mnt_userns. This function will then
+ * take care to map the inode according to @mnt_userns before checking
+ * permissions. On non-idmapped mounts or if permission checking is to be
+ * performed on the raw inode simply passs init_user_ns.
+ */ |
Looks like also these changes impact |
It looks like it could be a fairly large scope - so lmk if you want to dump progress onto your branch and then divide and conquer the remainder - I've pulled your 5.12 changes into my working fork |
i've got some changes already made for covering the autoconf xattr |
@ckane I haven't had a chance to make any more headway on this, and I won't have the time available for a while. If you wouldn't mind taking it over this work that would be wonderful. Probably the easiest thing to do would be to add my commit to your additional work, then you can open a new PR with all the needed changes. |
Sounds good! - I should have some time to work through this this week |
I've merged your branch into my repo, and rebased against master, and added my changes to the pile as well: https://github.com/ckane/zfs/tree/linux-5.12-compat I'll come in tonight and do a new PR |
@ckane great, then I'll go ahead and close out this PR. |
Motivation and Context
Resolve Linux 5.12 compatibility build failure.
Description
The inode_owner_or_capable() function was updated in the 5.12 kernel
to support idmapped mounts. As part of this change the user namespace
is now passed as the first argument. For non-idmapped mounts, which
are currently not supported, the initial user namespace may be passed
which will result in identical behavior as before.
How Has This Been Tested?
Locally compiled against the 5.12-rc1 kernel and basic functionality
was tested.
Types of changes
Checklist:
Signed-off-by
.