All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4
Date: Mon, 10 May 2021 10:47:39 -0300	[thread overview]
Message-ID: <20210510134739.37512-1-cascardo@canonical.com> (raw)

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


             reply	other threads:[~2021-05-10 13:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 13:47 Thadeu Lima de Souza Cascardo [this message]
2021-05-11  6:19 ` [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210510134739.37512-1-cascardo@canonical.com \
    --to=cascardo@canonical.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.