Skip to content
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 4.5 compat: Use xattr_handler->name for acl #4549

Closed
wants to merge 1 commit into from

Conversation

tuxoko
Copy link
Contributor

@tuxoko tuxoko commented Apr 22, 2016

Linux 4.5 added member "name" to xattr_handler. xattr_handler which matches to
whole name rather than prefix should use "name" instead of "prefix".
Otherwise, kernel will return with EINVAL when it tries to resolve handlers.

Signed-off-by: Chunwei Chen [email protected]

@behlendorf
Copy link
Contributor

@tuxoko nice fix. So after looking carefully at torvalds/linux@98e9cb5 it looks like we also need to wrap the following checks in zpl_xattr_acl_get_access, zpl_xattr_acl_set_access, zpl_xattr_acl_get_default, zpl_xattr_acl_set_default when using .name. The patch slightly changes the matching semantics.

#if !defined(HAVE_XATTR_HANDLER_NAME)
        if (strcmp(name, "") != 0)
                return (-EINVAL);
#endif

@tuxoko
Copy link
Contributor Author

tuxoko commented Apr 22, 2016

@behlendorf
Actually removing the strcmp doesn't change any semantic, it's just for cleaning up because the new xattr_resolve_name implies if (strcmp(name, "") != 0) return (-EINVAL); for acl and if (strcmp(name, "") == 0) return (-EINVAL); for others. But I'll update it anyway.

Linux 4.5 added member "name" to xattr_handler. xattr_handler which matches to
whole name rather than prefix should use "name" instead of "prefix".
Otherwise, kernel will return with EINVAL when it tries to resolve handlers.

Also, we remove the strcmp checks when xattr_handler has name, because
xattr_resolve_name will do the check for us.

Signed-off-by: Chunwei Chen <[email protected]>
@behlendorf
Copy link
Contributor

OK, thanks for the quick refresh. This LGTM.

@behlendorf behlendorf added this to the 0.6.5.7 milestone Apr 29, 2016
nedbass pushed a commit to nedbass/zfs that referenced this pull request May 6, 2016
Linux 4.5 added member "name" to xattr_handler. xattr_handler which matches to
whole name rather than prefix should use "name" instead of "prefix".
Otherwise, kernel will return with EINVAL when it tries to resolve handlers.

Also, we remove the strcmp checks when xattr_handler has name, because
xattr_resolve_name will do the check for us.

Signed-off-by: Chunwei Chen <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#4549
Closes openzfs#4537
ryao pushed a commit to ClusterHQ/zfs that referenced this pull request Jun 7, 2016
Linux 4.5 added member "name" to xattr_handler. xattr_handler which matches to
whole name rather than prefix should use "name" instead of "prefix".
Otherwise, kernel will return with EINVAL when it tries to resolve handlers.

Also, we remove the strcmp checks when xattr_handler has name, because
xattr_resolve_name will do the check for us.

Signed-off-by: Chunwei Chen <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#4549
Closes openzfs#4537
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants