ubifs: Convert xattr inum to host order
authorRichard Weinberger <richard@nod.at>
Tue, 14 May 2019 19:10:50 +0000 (21:10 +0200)
committerRichard Weinberger <richard@nod.at>
Wed, 15 May 2019 19:56:48 +0000 (21:56 +0200)
UBIFS stores inode numbers as LE64 integers.
We have to convert them to host oder, otherwise
BE hosts won't be able to use the integer correctly.

Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 9ca2d7326444 ("ubifs: Limit number of xattrs per inode")
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/xattr.c

index acab3181ab35f655e858a93558309be854d1d1b7..bcfed27e899740b7715c483cc6f58b5b129e74ba 100644 (file)
@@ -527,7 +527,7 @@ int ubifs_purge_xattrs(struct inode *host)
                fname_name(&nm) = xent->name;
                fname_len(&nm) = le16_to_cpu(xent->nlen);
 
-               xino = ubifs_iget(c->vfs_sb, xent->inum);
+               xino = ubifs_iget(c->vfs_sb, le64_to_cpu(xent->inum));
                if (IS_ERR(xino)) {
                        err = PTR_ERR(xino);
                        ubifs_err(c, "dead directory entry '%s', error %d",