From b763022c1c981871b2983d1eca008117ecd4cf7a Mon Sep 17 00:00:00 2001 From: Gao Xiang Date: Sun, 9 Mar 2025 01:35:23 +0800 Subject: [PATCH] erofs-utils: lib: fix insufficient fragment cache bitmap .. should round up to the nearest byte instead of down. Fixes: f511cfbbc0da ("erofs-utils: introduce fragment cache") Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20250308173523.3696606-1-hsiangkao@linux.alibaba.com --- lib/fragments.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fragments.c b/lib/fragments.c index 05bbf0d..d300439 100644 --- a/lib/fragments.c +++ b/lib/fragments.c @@ -402,7 +402,7 @@ int erofs_packedfile_init(struct erofs_sb_info *sbi, bool fragments_mkfs) err = -errno; goto err_out; } - epi->uptodate_size = BLK_ROUND_UP(sbi, ei.i_size) / 8; + epi->uptodate_size = DIV_ROUND_UP(BLK_ROUND_UP(sbi, ei.i_size), 8); epi->uptodate = calloc(1, epi->uptodate_size); if (!epi->uptodate) { err = -ENOMEM; -- 2.34.1