aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingbo Xu <jefflexu@linux.alibaba.com>2023-08-16 10:13:38 +0800
committerGao Xiang <hsiangkao@linux.alibaba.com>2023-08-21 08:01:19 +0800
commit7e0029e5c8897b3d1c2735f7f1083f2524d20093 (patch)
treeebb85af4f22c757b8b89b38a216c29b82e14944c
parent3721377e8cb6f4e02d3a25e7c313467120f85f22 (diff)
downloaderofs-utils-7e0029e5c8897b3d1c2735f7f1083f2524d20093.tar.gz
erofs-utils: lib: read i_ino in erofs_read_inode_from_disk()
i_ino[0] is a unique inode serial number in the erofs filesystem to count inodes one by one, while i_ino[1] is a unique number identifying the source inode in the source directory, which is usually derived from st->st_ino. Read on-disk ino and store it in i_ino[0] given the above background. Fixes: 5e35b75ad499 ("erofs-utils: introduce fuse implementation") Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com> Link: https://lore.kernel.org/r/20230816021347.126886-4-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
-rw-r--r--lib/namei.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/namei.c b/lib/namei.c
index 1023a9a..2bb1d4c 100644
--- a/lib/namei.c
+++ b/lib/namei.c
@@ -60,6 +60,7 @@ int erofs_read_inode_from_disk(struct erofs_inode *vi)
die = (struct erofs_inode_extended *)buf;
vi->xattr_isize = erofs_xattr_ibody_size(die->i_xattr_icount);
vi->i_mode = le16_to_cpu(die->i_mode);
+ vi->i_ino[0] = le32_to_cpu(die->i_ino);
switch (vi->i_mode & S_IFMT) {
case S_IFREG:
@@ -95,6 +96,7 @@ int erofs_read_inode_from_disk(struct erofs_inode *vi)
vi->inode_isize = sizeof(struct erofs_inode_compact);
vi->xattr_isize = erofs_xattr_ibody_size(dic->i_xattr_icount);
vi->i_mode = le16_to_cpu(dic->i_mode);
+ vi->i_ino[0] = le32_to_cpu(dic->i_ino);
switch (vi->i_mode & S_IFMT) {
case S_IFREG: