linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: David Turner <novalis@novalis.org>
Cc: Andreas Dilger <adilger@dilger.ca>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] e2fsck: Correct ext4 dates generated by old kernels
Date: Wed, 25 Nov 2015 04:46:32 -0500	[thread overview]
Message-ID: <20151125094632.GA2632@thunk.org> (raw)
In-Reply-To: <1448431295.7696.9.camel@novalis.org>

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.

					- Ted

  reply	other threads:[~2015-11-25  9:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 21:34 [PATCH] e2fsck: Correct ext4 dates generated by old kernels Andreas Dilger
2015-11-24 21:37 ` Andreas Dilger
2015-11-25  6:01 ` David Turner
2015-11-25  9:46   ` Theodore Ts'o [this message]
2015-11-26  5:27     ` David Turner
  -- strict thread matches above, loose matches on Subject: below --
2016-02-18 19:57 Andreas Dilger
2016-03-07  3:43 ` Theodore Ts'o
2016-03-07 11:34   ` Andreas Dilger
2016-03-07 15:27     ` Theodore Ts'o
2016-03-09  8:57       ` David Turner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151125094632.GA2632@thunk.org \
    --to=tytso@mit.edu \
    --cc=adilger@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=novalis@novalis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).