e2fsprogs/e2fsck
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
..
Android.bp Merge branch 'maint' into next 2021-01-28 00:52:22 -05:00
badblocks.c Fix clang warnings on architectures with a 64-bit long 2021-02-11 10:55:21 -05:00
CHANGES Fix historic typos in changelogs and release notes 2017-10-15 23:19:22 -04:00
dirinfo.c e2fsck: fix e2fsck_allocate_memory() overflow 2020-02-29 18:24:42 -05:00
dx_dirinfo.c e2fsck: reduce memory usage for many directories 2020-02-29 18:29:00 -05:00
e2fsck.8.in e2fsck.8.in: document check_encoding extended option 2021-01-27 22:19:35 -05:00
e2fsck.c e2fsck: fix check of directories over 4GB 2021-02-08 22:40:42 -05:00
e2fsck.conf.5.in e2fsck: add support for saving the problem code log 2019-05-06 10:15:41 -04:00
e2fsck.h e2fsck: fix check of directories over 4GB 2021-02-08 22:40:42 -05:00
ea_refcount.c Fix clang warnings on architectures with a 64-bit long 2021-02-11 10:55:21 -05:00
ehandler.c e2fsck: on read error, don't rewrite blocks past the end of the fs 2015-01-27 13:12:37 -05:00
emptydir.c e2fsck: consistently use ext2fs_get_mem() 2020-03-04 18:10:14 -05:00
encrypted_files.c e2fsck: check for consistent encryption policies 2019-10-09 20:18:20 -04:00
extend.c e2fsck: consistently use ext2fs_get_mem() 2020-03-04 18:10:14 -05:00
extents.c e2fsck: don't ignore return values in e2fsck_rewrite_extent_tree 2021-02-23 12:58:03 -05:00
flushb.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
iscan.c iscan: fix the test program iscan so it builds again 2021-02-26 17:18:48 -05:00
jfs_user.h Merge branch 'maint' into next 2021-01-28 00:52:22 -05:00
journal.c e2fsck: fix unaligned accesses to ext4_fc_add_range and fc_raw_inode 2021-05-06 22:40:57 -04:00
logfile.c e2fsck: fix e2fsck_allocate_memory() overflow 2020-02-29 18:24:42 -05:00
Makefile.in iscan: fix the test program iscan so it builds again 2021-02-26 17:18:48 -05:00
message.c Fix clang warnings on architectures with a 64-bit long 2021-02-11 10:55:21 -05:00
mtrace.awk Many files: 1997-04-26 13:21:57 +00:00
mtrace.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
mtrace.h ChangeLog, super.c: 2001-01-12 21:05:57 +00:00
pass1.c e2fsck: add error checking for ext2fs_extent_get_info() 2021-02-11 23:47:32 -05:00
pass1b.c Fix clang warnings on architectures with a 64-bit long 2021-02-11 10:55:21 -05:00
pass2.c e2fsck: fix ".." more gracefully if possible 2021-07-06 15:43:21 -04:00
pass3.c e2fsck: update the quota records when the root directory is recreated 2019-09-02 20:35:14 -04:00
pass4.c e2fsck: clarify overflow link count error message 2020-03-20 11:43:12 -04:00
pass5.c e2fsck: fix overflow if more than 4B inodes 2020-02-29 18:34:54 -05:00
problem.c blkid: include time.h to provide explicit declaration for time() 2021-04-11 19:52:57 -04:00
problem.h e2fsck: fix check of directories over 4GB 2021-02-08 22:40:42 -05:00
problemP.h e2fsck: add support for saving the problem code log 2019-05-06 10:15:41 -04:00
quota.c e2fsck: add proper error checking in move_quota_inode 2018-06-24 13:52:10 -04:00
readahead.c e2fsck: fix hang in readahead code if last block in fs is metadata 2018-06-28 11:10:58 -04:00
recovery.c e2fsck: fix portability problems caused by unaligned accesses 2021-05-06 14:02:51 -04:00
region.c Fix clang warnings on architectures with a 64-bit long 2021-02-11 10:55:21 -05:00
rehash.c Provide and use sort_r() instead of qsort_r() for portability reasons 2021-02-09 15:27:51 -05:00
revoke.c Revert "e2fsck: Change kmem_cache_t to lkmem_cache_t for Solaris" 2019-11-13 13:33:44 -05:00
scantest.c e2fsck: avoid mallinfo() if over 2GB allocated 2020-02-29 18:27:49 -05:00
sigcatcher.c Eliminate unused variable and unused label warnings from Android build 2015-07-13 10:47:16 -04:00
super.c e2fsck: fix last mount/write time when e2fsck is forced 2021-07-06 19:48:20 -04:00
unix.c Fix clang warnings on architectures with a 64-bit long 2021-02-11 10:55:21 -05:00
util.c Fix clang warnings on architectures with a 64-bit long 2021-02-11 10:55:21 -05:00