lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHB1NahGodp3=NovantwmhM2=faVWuuusfRPUiUZaXZt58K7Qg@mail.gmail.com>
Date: Thu, 12 Jun 2025 20:54:59 +0800
From: Julian Sun <sunjunchao2870@...il.com>
To: Ext4 Developers List <linux-ext4@...r.kernel.org>
Cc: Jan Kara <jack@...e.cz>, "Theodore Ts'o" <tytso@....edu>
Subject: Discrepancy between mkfs.ext4 man page and code on lazy_journal_init default

Hi,

Recently, I observed a significant difference in the number of
blk_mq_get_tag() calls when executing mkfs.ext4 -F -q /dev/$nvme
versus mkfs.ext4 -F -q -E lazy_itable_init=1,lazy_journal_init=1
/dev/$nvme. The former has over 2,000 more calls than the latter,
which is confusing because the mkfs.ext4 man page states both features
should be enabled by default. This implies the commands should be
equivalent, with no I/O difference.

       lazy_journal_init[= <0 to disable, 1 to enable>]
             If  enabled, the journal inode will not be
fully zeroed out by mke2fs.  This speeds up file system initialization
noticeably, but carries some small risk if the system crashes before
the journal has been overwritten entirely one time.  If the option
value is omitted, it defaults to 1 to enable lazy journal inode
                              ^^^^^^^^^^^
zeroing.

After examining the mkfs.ext4 source code, I found lazy_journal_init
is not enabled by default. The relevant snippet is:
       journal_flags |= get_bool_from_profile(fs_types,
                                     "lazy_journal_init", 0) ?
                                      EXT2_MKJOURNAL_LAZYINIT : 0;

Here, the default value passed to get_bool_from_profile is 0  , and
/etc/mke2fs.conf lacks lazy_journal_init configuration.
         root:~/e2fsprogs/build# grep lazy_journal_init /etc/mke2fs.conf
         root:~/e2fsprogs/build#

This behavior dates back to a 14-year-old commit 6c54689fadc3,
"mke2fs: skip zeroing journal blocks", contradicting the man page
explicitly.

Am I missing a configuration detail, or is this a genuine
documentation-code discrepancy? If the latter, I'm happy to submit a
patch to resolve it.

Any insights are much appreciated. Looking forward to your response.

ps:
root:~/e2fsprogs/build# mkfs.ext4 -V
mke2fs 1.47.3-rc1 (28-May-2025)
           Using EXT2FS Library version 1.47.3-rc1

Thanks,
-- 
Julian Sun <sunjunchao2870@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ