e2fsck: always fix invalid extra field in timestamps if time_t is 32-bits

Systems with 32-bit time_t's can be used past 2038, so we should
always modify dates with extra_time=3.  (On systems with 64-bit
time_t's we will fix these dates before the year 2242.)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debian
Theodore Ts'o 2016-05-29 01:05:06 -04:00
parent c64313084e
commit c40c832b4c
1 changed files with 3 additions and 1 deletions

View File

@ -512,7 +512,9 @@ static void check_inode_extra_space(e2fsck_t ctx, struct problem_context *pctx)
* If the inode's extended atime (ctime, crtime, mtime) is stored in
* the old, invalid format, repair it.
*/
if (sizeof(time_t) > 4 && ctx->now < EXT4_EXTRA_NEGATIVE_DATE_CUTOFF &&
if (((sizeof(time_t) <= 4) ||
((sizeof(time_t) > 4) &&
ctx->now < EXT4_EXTRA_NEGATIVE_DATE_CUTOFF)) &&
(CHECK_INODE_EXTRA_NEGATIVE_EPOCH(inode, atime) ||
CHECK_INODE_EXTRA_NEGATIVE_EPOCH(inode, ctime) ||
CHECK_INODE_EXTRA_NEGATIVE_EPOCH(inode, crtime) ||