`inode->fragment = NULL;` overrides `inode->fragmentoff`, which is unintended.
In fact, the latest stress test [1] had already failed, but I didn't notice it. Fedora openQA tests [2] also reported the issue. Fixes: 9fa1a5838a2a ("erofs-utils: mkfs: fix memory leak from small fragments") [1] https://github.com/erofs/erofsstress/actions/runs/15881657361 [2] https://bodhi.fedoraproject.org/updates/FEDORA-2025-e6256ddcc4 Signed-off-by: Gao Xiang <hsiang...@linux.alibaba.com> --- lib/fragments.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/fragments.c b/lib/fragments.c index 6111631..3278f47 100644 --- a/lib/fragments.c +++ b/lib/fragments.c @@ -365,7 +365,6 @@ int erofs_fragment_commit(struct erofs_inode *inode, u32 tofh) return 0; } inode->fragmentoff = (erofs_off_t)offset - len; - inode->fragment = NULL; free(fi->data); free(fi); return 0; -- 2.43.5