Whamcloud - gitweb
mke2fs: warn about missing y2038 support when formatting fresh ext4 fs
authorDarrick J. Wong <djwong@kernel.org>
Thu, 12 Aug 2021 23:22:22 +0000 (16:22 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 14 Aug 2021 19:10:42 +0000 (15:10 -0400)
commita23b50cdb55cb826b8745cbc37429c93f7b60c66
tree4d470cfcd7ed010d0c83e0c90849a4e93b522c2c
parentdc28833c3428c4dbc61be17ee6b20f57d8e8e842
mke2fs: warn about missing y2038 support when formatting fresh ext4 fs

Filesystems with 128-byte inodes do not support timestamps beyond the
year 2038.  Since we're now less than 16.5 years away from that point,
it's time to start warning users about this lack of support when they
format an ext4 filesystem with small inodes.

(Note that even for ext2 and ext3, we changed the default for
non-small file systems in 2008 in commit commit b1631cce648e ("Create
new filesystems with 256-byte inodes by default").)

So change the mke2fs.conf file to specify 256-byte inodes even for
small filesystems, and then add a warning to mke2fs itself if someone
is trying to make us format a file system with 128-byte inodes.  This
can be suppressed by setting the boolean option warn_y2038_dates in
the mke2fs.conf file to false, which we do in the case of GNU Hurd,
since it only supports 128 byte inodes as of this writing.

[ Patch reworked by tytso to only warn in the case of GNU Hurd, since
  the default for ext2/ext3 was changed for all but small file systems
  in 2008. ]

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
25 files changed:
misc/mke2fs.c
misc/mke2fs.conf.5.in
misc/mke2fs.conf.in
tests/f_detect_xfs/expect
tests/f_detect_xfs/expect.nodebugfs
tests/f_resize_inode/expect
tests/m_64bit_flexbg/expect.1
tests/m_dasd_bs/expect.1
tests/m_desc_size_128/expect.1
tests/m_extent_journal/expect.1
tests/m_hugefile_slack/expect
tests/m_meta_bg/expect.1
tests/m_mkfs_overhead/expect
tests/m_mmp/expect.1
tests/m_no_opt/expect.1
tests/m_raid_opt/expect.1
tests/m_root_owner/expect.1
tests/m_std/expect.1
tests/m_uninit/expect.1
tests/r_move_itable/expect
tests/r_resize_inode/expect
tests/t_enable_mcsum_ext3/expect
tests/t_iexpand_full/expect
tests/t_iexpand_mcsum/expect
tests/u_bounce_io/expect.1