Skip to content

Commit

Permalink
ubifs: Fix xattr generic handler usage
Browse files Browse the repository at this point in the history
UBIFS uses full names to work with xattrs, therefore we have to use
xattr_full_name() to obtain the xattr prefix as string.

Cc: <[email protected]>
Cc: Andreas Gruenbacher <[email protected]>
Fixes: 2b88fc2 ("ubifs: Switch to generic xattr handlers")
Signed-off-by: Richard Weinberger <[email protected]>
Reviewed-by: Andreas Gruenbacher <[email protected]>
Tested-by: Dongsheng Yang <[email protected]>
  • Loading branch information
richardweinberger committed Aug 23, 2016
1 parent c0082e9 commit 17ce1eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/ubifs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 17ce1eb

Please sign in to comment.