From 52cd773b5a10f5b7bfeff96137c49af84254bd68 Mon Sep 17 00:00:00 2001 From: Marcelo Politzer Date: Thu, 20 Apr 2023 14:31:14 -0300 Subject: [PATCH] fixup! fixup! Fix automatic block calculation and add -r to adjust extra size --- genext2fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genext2fs.c b/genext2fs.c index 7d6b857..7da8262 100644 --- a/genext2fs.c +++ b/genext2fs.c @@ -2568,7 +2568,7 @@ add2fs_from_tarball(filesystem *fs, uint32 this_nod, FILE * fh, int squash_uids, stats->ninodes++; break; case S_IFREG: - stats->nblocks += (filesize + BLOCKSIZE - 1) / BLOCKSIZE; + stats->nblocks += ifreg_blocks(filesize, BLOCKSIZE >> 11); case S_IFCHR: case S_IFBLK: case S_IFIFO: