tune2fs/fuse2fs/debugfs: after replaying the journal, fix up s_lastcheck

If the file system needs to have the journal replayed, but definition
it can't be freshly checked.  So if the time when the file system was
last checked (s_lastcheck) is before the time it was last mounted
(s_mtime), force s_lastcheck to be before s_mtime.

This is necessary to make sure some of tune2fs's safety checks work
correctly after replaying the journal, since some of tune2fs's
operations really require that the file system be self-consistent or
grave damage can result.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 file changed