mkfs: force block size to 1024 for ext3 and ext4
PATCH 1/1 mkfs: force block size to 1024 for ext3 and ext4
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.
/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.
--- testcases/commands/mkfs/mkfs01.sh | 3 +++ 1 file changed, 3 insertions(+)
testcases/commands/mkfs/mkfs01.sh +3 -0
@@ -96,6 +96,9 @@ mkfs_test() if [ "$fs_type" = "xfs" ] || [ "$fs_type" = "btrfs" ]; then fs_op="$fs_op -f" fi + if [ "$fs_type" = "ext3" ] || [ "$fs_type" = "ext4" ]; then + fs_op="$fs_op -b 1024" + fi local mkfs_cmd="mkfs $mkfs_op $fs_op $device $size"
Signature · 1 line
2.27.0
PATCH 1/1 mkfs: force block size to 1024 for ext3 and ext4
Hi,
Quoted 3 lines
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?
Quoted 7 lines
/etc/mke2fs.confwill 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.
Kind regards,
Petr
PATCH 1/1 mkfs: force block size to 1024 for ext3 and ext4
Quoted 6 lines · Petr Vorel
Hi,
Quoted 3 lines
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.
Quoted 11 lines
Quoted 8 lines
/etc/mke2fs.confwill 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.
Quoted 3 lines
Kind regards,
Petr
PATCH 1/1 mkfs: force block size to 1024 for ext3 and ext4
Hi,
Quoted 6 lines · Petr Vorel
Quoted 5 lines
Hi,
Quoted 3 lines
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.
Quoted 8 lines
Quoted 1 line
Is that any actual problem?
It causes the test to fail.
mkfs01 2 TFAIL: 'mkfs -t ext4/dev/loop016000' 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
Quoted 19 lines
Quoted 10 lines
Quoted 7 lines
/etc/mke2fs.confwill 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.
PATCH 1/1 mkfs: force block size to 1024 for ext3 and ext4
Quoted 17 lines · Petr Vorel
Hi,
Quoted 6 lines · Petr Vorel
Quoted 5 lines
Hi,
Quoted 3 lines
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.
Quoted 8 lines
Quoted 1 line
Is that any actual problem?
It causes the test to fail.
mkfs01 2 TFAIL: 'mkfs -t ext4/dev/loop016000' 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.
Quoted 7 lines
Have you checked if
d44387457("mkfs: relax size check") fixes the issue?https://github.com/linux-test-project/ltp/commit/d4438745751dc4b0faa50063f9a0d9542f0ceaac
Kind regards,
Petr
It does not. That would have to move to something below 80%.
Cascardo.
Quoted 19 lines
Quoted 19 lines
Quoted 10 lines
Quoted 7 lines
/etc/mke2fs.confwill 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.
PATCH 1/1 mkfs: force block size to 1024 for ext3 and ext4
In reply to Thadeu Lima de Souza CascardoHi!
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
/etc/mke2fs.confwill 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.
Quoted 8 lines
Quoted 2 lines
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?
I guess that we should merge your fix in order to have the test working for the upcomming release. Then we can discuss if this should be fixed differently or not.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/1 mkfs: force block size to 1024 for ext3 and ext4
Hi,
[Cc Jan]
Quoted 16 lines
Hi!
Quoted 14 lines
Quoted 10 lines
Quoted 7 lines
/etc/mke2fs.confwill 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.
Quoted 5 lines
Quoted 1 line
What do you think?
I guess that we should merge your fix in order to have the test working for the upcomming release. Then we can discuss if this should be fixed differently or not.
Kind regards,
Petr
PATCH 1/1 mkfs: force block size to 1024 for ext3 and ext4
Quoted 21 lines · Petr Vorel
Hi,
[Cc Jan]
Quoted 15 lines
Hi!
Quoted 14 lines
Quoted 10 lines
Quoted 7 lines
/etc/mke2fs.confwill 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.
Quoted 6 lines
Quoted 5 lines
Quoted 1 line
What do you think?
I guess that we should merge your fix in order to have the test working for the upcomming release. Then we can discuss if this should be fixed differently or not.
Acked-by Petr Vorel <[email protected]>
Fine by me (I don't have a better idea atm.)
Quoted 4 lines
Kind regards,
Petr
PATCH 1/1 mkfs: force block size to 1024 for ext3 and ext4
Hi!
Pushed with the acks.
Signature · 2 lines
Cyril Hrubis [email protected]