[PATCH 1/3] erofs-utils: mkfs: fix incremental builds with 48-bit layout

Gao Xiang hsiangkao at linux.alibaba.com
Sun Sep 28 16:32:30 AEST 2025


Fix erofs_lookupnid() because the root inode can be relocated
in the 48-bit layout.

Fixes: d41a717721a2 ("erofs-utils: mkfs: support 48-bit block addressing for unencoded inodes")
Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>
---
 lib/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/inode.c b/lib/inode.c
index 7b80530..0b5e77a 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -414,7 +414,7 @@ erofs_nid_t erofs_lookupnid(struct erofs_inode *inode)
 	if (__erofs_unlikely(IS_ROOT(inode))) {
 		if (inode->in_metabox)
 			DBG_BUGON(!erofs_sb_has_48bit(sbi));
-		else if (inode->nid > 0xffff)
+		else if (!erofs_sb_has_48bit(sbi) && inode->nid > 0xffff)
 			return sbi->root_nid;
 	}
 	return inode->nid;
-- 
2.43.5



More information about the Linux-erofs mailing list