The root cause is the same as commit d9baceba7026 ("erofs-utils:
fix -Ededupe crash without fragments enabled").

In fact, the fragment manager should be reworked in the next major
erofs-utils version to avoid those dirty hacks.

Fixes: fc880e31b7c7 ("erofs-utils: mkfs: minor cleanup & rearrangement")
Signed-off-by: Gao Xiang <hsiang...@linux.alibaba.com>
---
 mkfs/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mkfs/main.c b/mkfs/main.c
index 7d559d9..27c333c 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -1450,7 +1450,8 @@ int main(int argc, char **argv)
        if (erofstar.index_mode && g_sbi.extra_devices && !erofstar.mapfile)
                g_sbi.devs[0].blocks = BLK_ROUND_UP(&g_sbi, erofstar.offset);
 
-       if (erofs_sb_has_fragments(&g_sbi)) {
+       if ((cfg.c_fragments || cfg.c_extra_ea_name_prefixes) &&
+           erofs_sb_has_fragments(&g_sbi)) {
                erofs_update_progressinfo("Handling packed data ...");
                err = erofs_flush_packed_inode(&g_sbi);
                if (err)
-- 
2.43.5

Reply via email to