]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
Add post-2038 timestamp support to e2fsprogs
authorAndreas Dilger <adilger@dilger.ca>
Wed, 27 Sep 2023 05:40:16 +0000 (23:40 -0600)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 31 Mar 2024 17:54:33 +0000 (13:54 -0400)
commitca8bc9240a00665dd4c96de350e610add8543a08
treef4bcab265b4afc14deabf94ebcfc75af0db6e52d
parentf8728c88c089a75abcc8bbfd00e19a050b97eb08
Add post-2038 timestamp support to e2fsprogs

The ext4 kernel code implemented support for s_mtime_hi,
s_wtime_hi, and related timestamp fields to avoid timestamp
overflow in 2038, but similar handling is not in e2fsprogs.

Add helper macros for the superblock _hi timestamp fields
ext2fs_super_tstamp_get() and ext2fs_super_tstamp_set().

Add helper macro for inode _extra timestamp fields
ext2fs_inode_xtime_get() and ext2fs_inode_xtime_set().

Add helper macro ext2fs_actual_inode_size() to avoid open
coding the i_extra_isize check in multiple places.

Remove inode_time_to_string() since this is unused once callers
change to time_to_string(ext2fs_inode_xtime_get()) directly.

Fix inode_includes() macro to properly wrap "inode" parameter,
and rename to ext2fs_inode_includes() to avoid potential name
clashes.  Use this to check inode field inclusion in debugfs
instead of bare constants for inode field offsets.

Use these interfaces to access timestamps in debugfs, e2fsck,
libext2fs, fuse2fs, tune2fs, and e2undo.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Link: https://lore.kernel.org/r/20230927054016.16645-1-adilger@dilger.ca
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
29 files changed:
debugfs/debugfs.c
debugfs/debugfs.h
debugfs/journal.c
debugfs/set_fields.c
debugfs/util.c
e2fsck/message.c
e2fsck/pass1.c
e2fsck/pass3.c
e2fsck/super.c
e2fsck/unix.c
lib/e2p/ls.c
lib/ext2fs/bb_inode.c
lib/ext2fs/closefs.c
lib/ext2fs/ext2_fs.h
lib/ext2fs/ext2fs.h
lib/ext2fs/initialize.c
lib/ext2fs/inode.c
lib/ext2fs/mkjournal.c
lib/ext2fs/orphan.c
lib/ext2fs/res_gdt.c
lib/ext2fs/swapfs.c
lib/support/mkquota.c
lib/support/plausible.c
lib/support/quotaio.c
misc/create_inode.c
misc/e2undo.c
misc/findsuper.c
misc/fuse2fs.c
misc/tune2fs.c