Re: [PATCH] e2fsck: Correct ext4 dates generated by old kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2015-11-25 at 04:46 -0500, Theodore Ts'o wrote:
> On Wed, Nov 25, 2015 at 01:01:35AM -0500, David Turner wrote:
> > On Tue, 2015-11-24 at 14:34 -0700, Andreas Dilger wrote: 
> > > +static int check_inode_extra_negative_epoch(__u32 xtime, __u32
> > > extra) {
> > > +	return (xtime & (1 << 31)) != 0 &&
> > 
> > On a re-read, I think the bitshift is technically undefined
> > behavior
> > because 1 is signed and 2**31 is not representable as a signed (32
> > -bit)
> > int. Changing it to 1U should fix it.
> 
> Instead of doing all of the bitshifts, I was thinking about doing
> something much simpler:
> 
> 	...
> 	if (inode->ctime_hi == 3 && fix_problem(....)
> 		inode->ctime_hi = 0;
> 	if (inode->mtime_hi == 3 && fix_problem(....)
> 		inode->mtime_hi = 0;
> 
> Hmm?  That should work just as well, and is easier to read and
> understand what's going on, and matches with the test we are using in
> the kernel.

I think we also need to check that the {a,c,m}time has the high bit
set.
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux