All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4
@ 2021-05-10 13:47 Thadeu Lima de Souza Cascardo
  2021-05-11  6:19 ` Petr Vorel
  0 siblings, 1 reply; 9+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2021-05-10 13:47 UTC (permalink / raw)
  To: ltp

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.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 testcases/commands/mkfs/mkfs01.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testcases/commands/mkfs/mkfs01.sh b/testcases/commands/mkfs/mkfs01.sh
index 3e3e56719cf3..17c7fb9e4a1a 100755
--- a/testcases/commands/mkfs/mkfs01.sh
+++ b/testcases/commands/mkfs/mkfs01.sh
@@ -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"
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4
  2021-05-10 13:47 [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4 Thadeu Lima de Souza Cascardo
@ 2021-05-11  6:19 ` Petr Vorel
  2021-05-11 10:36   ` Thadeu Lima de Souza Cascardo
  0 siblings, 1 reply; 9+ messages in thread
From: Petr Vorel @ 2021-05-11  6:19 UTC (permalink / raw)
  To: ltp

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?

> /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.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4
  2021-05-11  6:19 ` Petr Vorel
@ 2021-05-11 10:36   ` Thadeu Lima de Souza Cascardo
  2021-05-11 14:19     ` Petr Vorel
  2021-05-12 13:17     ` Cyril Hrubis
  0 siblings, 2 replies; 9+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2021-05-11 10:36 UTC (permalink / raw)
  To: ltp

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.

> 
> > /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.

> 
> Kind regards,
> Petr

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4
  2021-05-11 10:36   ` Thadeu Lima de Souza Cascardo
@ 2021-05-11 14:19     ` Petr Vorel
  2021-05-11 15:28       ` Thadeu Lima de Souza Cascardo
  2021-05-12 13:17     ` Cyril Hrubis
  1 sibling, 1 reply; 9+ messages in thread
From: Petr Vorel @ 2021-05-11 14:19 UTC (permalink / raw)
  To: ltp

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4
  2021-05-11 14:19     ` Petr Vorel
@ 2021-05-11 15:28       ` Thadeu Lima de Souza Cascardo
  0 siblings, 0 replies; 9+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2021-05-11 15:28 UTC (permalink / raw)
  To: ltp

On Tue, May 11, 2021 at 04:19:19PM +0200, Petr Vorel wrote:
> 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
> 

It does not. That would have to move to something below 80%.

Cascardo.

> > > > /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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4
  2021-05-11 10:36   ` Thadeu Lima de Souza Cascardo
  2021-05-11 14:19     ` Petr Vorel
@ 2021-05-12 13:17     ` Cyril Hrubis
  2021-05-12 13:55       ` Petr Vorel
  1 sibling, 1 reply; 9+ messages in thread
From: Cyril Hrubis @ 2021-05-12 13:17 UTC (permalink / raw)
  To: ltp

Hi!
> > > /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?

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.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4
  2021-05-12 13:17     ` Cyril Hrubis
@ 2021-05-12 13:55       ` Petr Vorel
  2021-05-12 13:59         ` Jan Stancek
  0 siblings, 1 reply; 9+ messages in thread
From: Petr Vorel @ 2021-05-12 13:55 UTC (permalink / raw)
  To: ltp

Hi,

[Cc Jan]

> Hi!
> > > > /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?

> 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 <pvorel@suse.cz>

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4
  2021-05-12 13:55       ` Petr Vorel
@ 2021-05-12 13:59         ` Jan Stancek
  2021-05-12 14:18           ` Cyril Hrubis
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Stancek @ 2021-05-12 13:59 UTC (permalink / raw)
  To: ltp

On Wed, May 12, 2021 at 3:55 PM Petr Vorel <pvorel@suse.cz> wrote:
>
> Hi,
>
> [Cc Jan]
>
> > Hi!
> > > > > /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?
>
> > 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 <pvorel@suse.cz>

Fine by me (I don't have a better idea atm.)

>
> Kind regards,
> Petr
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4
  2021-05-12 13:59         ` Jan Stancek
@ 2021-05-12 14:18           ` Cyril Hrubis
  0 siblings, 0 replies; 9+ messages in thread
From: Cyril Hrubis @ 2021-05-12 14:18 UTC (permalink / raw)
  To: ltp

Hi!
Pushed with the acks.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-05-12 14:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10 13:47 [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4 Thadeu Lima de Souza Cascardo
2021-05-11  6:19 ` Petr Vorel
2021-05-11 10:36   ` Thadeu Lima de Souza Cascardo
2021-05-11 14:19     ` Petr Vorel
2021-05-11 15:28       ` Thadeu Lima de Souza Cascardo
2021-05-12 13:17     ` Cyril Hrubis
2021-05-12 13:55       ` Petr Vorel
2021-05-12 13:59         ` Jan Stancek
2021-05-12 14:18           ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.