]> www.infradead.org Git - mtd-utils.git/commitdiff
mkfs.ubifs: Fix wrong xattr entry type
authorZhihao Cheng <chengzhihao1@huawei.com>
Thu, 9 May 2024 11:41:28 +0000 (19:41 +0800)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Wed, 25 Sep 2024 07:08:41 +0000 (09:08 +0200)
The type of xattr entry should be regular file, otherwise xattr entry
and xattr inode have inconsistent types.

Fixes: 50044efbd6e713 ("mkfs.ubifs: Add extended attribute support")
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
ubifs-utils/mkfs.ubifs/mkfs.ubifs.c

index b91a3e2df4d34aaf32a3906a8b1149b40ead22f1..f92a1ed26ea04d5673ff540e3759dc1831dbfe7d 100644 (file)
@@ -1243,7 +1243,7 @@ static int add_xattr(struct ubifs_ino_node *host_ino, struct stat *st,
 
        xent->ch.len = len;
        xent->padding1 = 0;
-       xent->type = UBIFS_ITYPE_DIR;
+       xent->type = UBIFS_ITYPE_REG;
        xent->nlen = cpu_to_le16(nm.len);
 
        memcpy(xent->name, nm.name, nm.len + 1);