staging: lustre: llite: use xattr_handler name for ACLs
If struct xattr_handler has a name member then use it (rather than prefix) for the ACL xattrs. This avoids a bug where ACL operations failed for some kernels. Signed-off-by: John L. Hammond <john.hammond@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10785 Reviewed-on: https://review.whamcloud.com/ Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
695e3d604a
commit
ab42bc0128
@ -46,15 +46,16 @@
|
||||
|
||||
const struct xattr_handler *get_xattr_type(const char *name)
|
||||
{
|
||||
int i = 0;
|
||||
int i;
|
||||
|
||||
while (ll_xattr_handlers[i]) {
|
||||
size_t len = strlen(ll_xattr_handlers[i]->prefix);
|
||||
for (i = 0; ll_xattr_handlers[i]; i++) {
|
||||
const char *prefix = xattr_prefix(ll_xattr_handlers[i]);
|
||||
size_t prefix_len = strlen(prefix);
|
||||
|
||||
if (!strncmp(ll_xattr_handlers[i]->prefix, name, len))
|
||||
if (!strncmp(prefix, name, prefix_len))
|
||||
return ll_xattr_handlers[i];
|
||||
i++;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -627,14 +628,14 @@ static const struct xattr_handler ll_security_xattr_handler = {
|
||||
};
|
||||
|
||||
static const struct xattr_handler ll_acl_access_xattr_handler = {
|
||||
.prefix = XATTR_NAME_POSIX_ACL_ACCESS,
|
||||
.name = XATTR_NAME_POSIX_ACL_ACCESS,
|
||||
.flags = XATTR_ACL_ACCESS_T,
|
||||
.get = ll_xattr_get_common,
|
||||
.set = ll_xattr_set_common,
|
||||
};
|
||||
|
||||
static const struct xattr_handler ll_acl_default_xattr_handler = {
|
||||
.prefix = XATTR_NAME_POSIX_ACL_DEFAULT,
|
||||
.name = XATTR_NAME_POSIX_ACL_DEFAULT,
|
||||
.flags = XATTR_ACL_DEFAULT_T,
|
||||
.get = ll_xattr_get_common,
|
||||
.set = ll_xattr_set_common,
|
||||
|
Loading…
Reference in New Issue
Block a user