[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADQUmxVEyV796xTuy6LytketqEDsCQYH0vOpH79FSfo9mhgsEw@mail.gmail.com>
Date: Thu, 14 Nov 2013 02:15:06 -0800
From: Mark Harris <mhlk@....us>
To: David Turner <novalis@...alis.org>
Cc: Andreas Dilger <adilger@...ger.ca>,
"Theodore Ts'o" <tytso@....edu>, Jan Kara <jack@...e.cz>,
Ext4 Developers List <linux-ext4@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5 2/2] e2fsck: Correct ext4 dates generated by old kernels.
> +/* When today's date is earlier than 2242, we assume that atimes,
> + * ctimes, and mtimes greater than 2242 are actually pre-1970 dates
...mtimes with years in the range 2310..2378 are...
> + * mis-encoded.
> + */
> +#define EXT4_EXTRA_NEGATIVE_DATE_CUTOFF 5 * (1ULL << 32)
Wouldn't 2242 be 0x200000000ULL, i.e. 2 * (1ULL << 32)?
> +
> + /*
> + * If the inode's extended atime (ctime, mtime) is stored in
> + * the old, invalid format, the inode is corrupt.
> + */
> + if (sizeof(time_t) > 4 && ctx->now < EXT4_EXTRA_NEGATIVE_DATE_CUTOFF &&
Needs parentheses (
> + CHECK_INODE_EXTRA_NEGATIVE_EPOCH(inode, atime) ||
> + CHECK_INODE_EXTRA_NEGATIVE_EPOCH(inode, ctime) ||
> + CHECK_INODE_EXTRA_NEGATIVE_EPOCH(inode, mtime)) {
)
> +
> + if (!fix_problem(ctx, PR_1_EA_TIME_OUT_OF_RANGE, pctx))
> + return;
> +
> + inode->i_atime_extra &= ~EXT4_EPOCH_MASK;
> + inode->i_ctime_extra &= ~EXT4_EPOCH_MASK;
> + inode->i_mtime_extra &= ~EXT4_EPOCH_MASK;
With e.g. 2039 atime and 1968 mtime, shouldn't only i_mtime_extra be altered?
> + e2fsck_write_inode_full(ctx, pctx->ino, pctx->inode,
> + EXT2_INODE_SIZE(sb), "pass1");
> + }
- Mark
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists