Commit 17ce1eb0 authored by Richard Weinberger's avatar Richard Weinberger

ubifs: Fix xattr generic handler usage

UBIFS uses full names to work with xattrs, therefore we have to use
xattr_full_name() to obtain the xattr prefix as string.

Cc: <stable@vger.kernel.org>
Cc: Andreas Gruenbacher <agruenba@redhat.com>
Fixes: 2b88fc21 ("ubifs: Switch to generic xattr handlers")
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Reviewed-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Tested-by: default avatarDongsheng Yang <dongsheng081251@gmail.com>
parent c0082e98
...@@ -575,6 +575,7 @@ static int ubifs_xattr_get(const struct xattr_handler *handler, ...@@ -575,6 +575,7 @@ static int ubifs_xattr_get(const struct xattr_handler *handler,
dbg_gen("xattr '%s', ino %lu ('%pd'), buf size %zd", name, dbg_gen("xattr '%s', ino %lu ('%pd'), buf size %zd", name,
inode->i_ino, dentry, size); inode->i_ino, dentry, size);
name = xattr_full_name(handler, name);
return __ubifs_getxattr(inode, name, buffer, size); return __ubifs_getxattr(inode, name, buffer, size);
} }
...@@ -586,6 +587,8 @@ static int ubifs_xattr_set(const struct xattr_handler *handler, ...@@ -586,6 +587,8 @@ static int ubifs_xattr_set(const struct xattr_handler *handler,
dbg_gen("xattr '%s', host ino %lu ('%pd'), size %zd", dbg_gen("xattr '%s', host ino %lu ('%pd'), size %zd",
name, inode->i_ino, dentry, size); name, inode->i_ino, dentry, size);
name = xattr_full_name(handler, name);
if (value) if (value)
return __ubifs_setxattr(inode, name, value, size, flags); return __ubifs_setxattr(inode, name, value, size, flags);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment