summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2016-07-31 21:42:23 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-15 08:20:28 +0200
commit1ee6296b23cb5f6b297011defd8a2a637088c689 (patch)
tree50f0d7a0716684db08a9cc121e8ec3880cd4f4d5
parentdcfeecd938a75f52faa17f437a08d83001b32da2 (diff)
downloadlinux-stable-1ee6296b23cb5f6b297011defd8a2a637088c689.tar.gz
linux-stable-1ee6296b23cb5f6b297011defd8a2a637088c689.tar.bz2
linux-stable-1ee6296b23cb5f6b297011defd8a2a637088c689.zip
ubifs: Fix xattr generic handler usage
commit 17ce1eb0b64eb27d4f9180daae7495fa022c7b0d upstream. UBIFS uses full names to work with xattrs, therefore we have to use xattr_full_name() to obtain the xattr prefix as string. Cc: Andreas Gruenbacher <agruenba@redhat.com> Fixes: 2b88fc21ca ("ubifs: Switch to generic xattr handlers") Signed-off-by: Richard Weinberger <richard@nod.at> Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com> Tested-by: Dongsheng Yang <dongsheng081251@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/ubifs/xattr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
index b5fc27969e9d..c63710fbd95d 100644
--- a/fs/ubifs/xattr.c
+++ b/fs/ubifs/xattr.c
@@ -575,7 +575,8 @@ static int ubifs_xattr_get(const struct xattr_handler *handler,
dbg_gen("xattr '%s', ino %lu ('%pd'), buf size %zd", name,
inode->i_ino, dentry, size);
- return __ubifs_getxattr(inode, name, buffer, size);
+ name = xattr_full_name(handler, name);
+ return __ubifs_getxattr(inode, name, buffer, size);
}
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",
name, inode->i_ino, dentry, size);
+ name = xattr_full_name(handler, name);
+
if (value)
return __ubifs_setxattr(inode, name, value, size, flags);
else