From 7d8d7660188071a3710a6399c42a1613338f41a6 Mon Sep 17 00:00:00 2001 From: guohao15 Date: Sat, 27 Apr 2024 20:01:26 +0800 Subject: [PATCH] romfs:bugfix use origoffset instead of offset origoffset represent the offset of current node offset represent the offset of the file when the current node is a soft or hard link Signed-off-by: guohao15 --- fs/romfs/fs_romfsutil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/romfs/fs_romfsutil.c b/fs/romfs/fs_romfsutil.c index 16dd0d1045..a040e97385 100644 --- a/fs/romfs/fs_romfsutil.c +++ b/fs/romfs/fs_romfsutil.c @@ -563,8 +563,8 @@ static int romfs_cachenode(FAR struct romfs_mountpt_s *rm, } rm->rm_volsize += totalsize; - ret = romfs_alloc_spareregion(&rm->rm_sparelist, offset, - offset + totalsize); + ret = romfs_alloc_spareregion(&rm->rm_sparelist, origoffset, + origoffset + totalsize); if (ret < 0) { return ret;