[LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4

Petr Vorel pvorel@suse.cz
Tue May 11 16:19:19 CEST 2021


Hi,

> On Tue, May 11, 2021 at 08:19:01AM +0200, Petr Vorel wrote:
> > Hi,

> > > ext3 and ext4 filesystems will reserve at least 1024 blocks for the
> > > journal.  With a blocksize of 4096, this will be 25% of the filesystem size
> > > without accounting for any other overhead.
> > Is that any actual problem?

> It causes the test to fail.
>      mkfs01 2 TFAIL: 'mkfs -t ext4  /dev/loop0 16000' failed, unexpected size.

> The filesystem size is very small, 16K 1k blocks, and we test that there are at
> least 80% of that available. As I said, the journal takes at least 1024 blocks,
> and with 4k blocks, that is too much overhead.

Have you checked if d44387457 ("mkfs: relax size check") fixes the issue?

https://github.com/linux-test-project/ltp/commit/d4438745751dc4b0faa50063f9a0d9542f0ceaac

Kind regards,
Petr

> > > /etc/mke2fs.conf will use 1024 block size for small filesystems, which are
> > > between 3M and 512M. However, on recent versions of Ubuntu, this
> > > configuration has changed and thet default blocksize is 4096 even for small
> > > filesystems.

> > > Force the blocksize to 1024 on ext3 and ext4 filesystems, which will lead
> > > to the expected results, as journals will take only 1M.

> > IMHO it'd be better to keep the default, because that covers what end users
> > actually use.

> One alternative to forcing the block size is accouting for the journal blocks,
> but, then, that needs to consider the block size. I think my approach is more
> simple. We could restrict it to the smaller 16M filesystem, though.

> What do you think?

> Thanks.
> Cascardo.


More information about the ltp mailing list