Go to file
Lukas Czerner 2c69c94217 e2fsck: fix last mount/write time when e2fsck is forced
With commit c52d930f e2fsck is no longer able to fix bad last
mount/write time by default because it is conditioned on s_checkinterval
not being zero, which it is by default.

One place where it matters is when other e2fsprogs tools require to run
full file system check before a certain operation. If the last mount
time is for any reason in future, it will not allow it to run even if
full e2fsck is ran.

Fix it by checking the last mount/write time when the e2fsck is forced,
except for the case where we know the system clock is broken.

[ Reworked the conditionals so error messages claiming that the last
  write/mount time were corrupted wouldn't be always printed when the
  e2fsck was run with the -f option, thus causing 299 out of 372
  regression tests to fail.  -- TYT ]

Fixes: c52d930f ("e2fsck: don't check for future superblock times if checkinterval == 0")
Reported-by: Dusty Mabe <dustymabe@redhat.com>
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2021-07-06 19:48:20 -04:00
config Update gettext files to version 0.19.8 2020-11-25 11:55:46 -05:00
contrib misc: replace remaining loff_t with ext2_loff_t 2021-02-22 21:53:53 -05:00
debian Update release notes, etc., for the 1.46.2 release 2021-02-28 21:46:44 -05:00
debugfs e2fsck: fix unaligned accesses to ext4_fc_tl struct 2021-05-06 21:57:15 -04:00
doc Update release notes, etc., for the 1.46.2 release 2021-02-28 21:46:44 -05:00
e2fsck e2fsck: fix last mount/write time when e2fsck is forced 2021-07-06 19:48:20 -04:00
ext2ed Define MKDIR_P in the Makefile.in files instead in MCONFIG.in 2020-10-04 23:05:01 -04:00
include libext2fs: code adaptation to use the Windows IO manager 2021-03-31 16:09:14 -04:00
install-utils Remove Changelog files since they're not used after the git migration 2007-07-08 08:50:41 -04:00
lib libext2fs: use offsetof() from stddef.h 2021-07-05 20:22:57 -04:00
misc filefrag: minor usability improvements 2021-04-02 16:04:38 -04:00
po Update release notes, etc., for the 1.46.2 release 2021-02-28 21:46:44 -05:00
resize resize2fs: close the file system on errors or early exits 2021-03-06 23:54:33 -05:00
scrub Define MKDIR_P in the Makefile.in files instead in MCONFIG.in 2020-10-04 23:05:01 -04:00
tests e2fsck: fix ".." more gracefully if possible 2021-07-06 15:43:21 -04:00
util libext2fs: code adaptation to use the Windows IO manager 2021-03-31 16:09:14 -04:00
.gitignore misc: add e2mmpstatus utility via dumpe2fs 2018-06-22 18:22:37 -04:00
.missing-copyright Many files: 1997-04-29 16:15:03 +00:00
.release-checklist Update release notes, etc., for the 1.46.2 release 2021-02-28 21:46:44 -05:00
ABOUT-NLS Update gettext files to version 0.19.8 2020-11-25 11:55:46 -05:00
acinclude.m4 configure: don't fail if /usr/include/sys/mount.h does not exist 2019-11-13 13:55:29 -05:00
aclocal.m4 Add configure and build support for the pthreads library 2021-01-21 10:50:40 -05:00
Android.bp AOSP: Turn off some more warnings on Windows. 2019-04-22 13:35:03 -04:00
CleanSpec.mk AOSP: e2fsdroid and mke2fs are dynamic executable in recovery partition 2018-06-27 23:51:40 -04:00
configure ext2fs: compile the io implementation according to os 2021-03-31 16:09:23 -04:00
configure.ac ext2fs: compile the io implementation according to os 2021-03-31 16:09:23 -04:00
depfix.sed Update Release Notes, Changelogs, version.h, etc. for 1.42 release 2011-11-29 16:48:14 -05:00
e2fsprogs.lsm Update release notes, etc., for the 1.46.2 release 2021-02-28 21:46:44 -05:00
e2fsprogs.spec Update release notes, etc., for the 1.46.1 release 2021-02-09 18:36:32 -05:00
INSTALL Fix typos in code comments and developer docs 2017-10-15 23:00:11 -04:00
INSTALL.elfbin Fix typos in code comments and developer docs 2017-10-15 23:00:11 -04:00
Makefile.in Merge branch 'maint' into next 2021-01-19 23:58:57 -05:00
MCONFIG.in Include PTHREAD_CFLAGS in LDFLAGS* macros 2021-01-23 01:02:19 -05:00
NOTICE e2fsprogs: fix Free Software Foundation address 2018-04-19 11:39:09 -04:00
README Update release notes, etc., for the 1.46.2 release 2021-02-28 21:46:44 -05:00
RELEASE-NOTES Update release notes, etc., for the 1.46.2 release 2021-02-28 21:46:44 -05:00
SHLIBS Many files: 1997-04-29 16:15:03 +00:00
SUBMITTING-PATCHES Added SUBMITTING-PATCHES file 2005-07-05 22:30:13 -05:00
version.h Update release notes, etc., for the 1.46.2 release 2021-02-28 21:46:44 -05:00
wordwrap.pl Fix wordwrap.pl so it is more portable 2012-09-21 12:50:04 -04:00

	This is the new version (1.46.2) of the second extended file
system management programs.

	From time to time, I release new versions of e2fsprogs, to fix
bugs and to make the utilities more robust.  You can always find
information about the latest version at the the e2fsprogs web page,
which is:

	http://e2fsprogs.sourceforge.net

	The INSTALL file has instructions on building and installing
e2fsprogs.  Provisions for building Red Hat RPMs and Debian dpkg files
are supplied as well.

	In case of bugs in these programs, please contact Ted Ts'o at
tytso@mit.edu or tytso@alum.mit.edu.  See the e2fsck man page for
suggestions of what sort of information to include when submitting bug
reports for these programs.