Subject: Re: [BUG ext4?] Working tree getting out of date "spontaneously"

From: Theodore Tso <[email-masked]>
Date: Fri, 5 Jun 2009 17:38:24 -0400

On Fri, Jun 05, 2009 at 08:35:38PM +0200, Björn Steinbrink wrote:
> > So the next step is to create an ext3 filesystem with a git repository
> > on it, and then to gradually turn on various ext4 specific features
> > and see when the bug ends up getting replicated.  If I had to guess
> > it's the lack (or absense) of the extents feature, but I'll have to
> > run the test and find out for sure.
> 
> Yep, seems to be extents. Test script:

OK, I see what's going on.  When doing delayed allocation, and we're
not using extents, the call to ext4_get_blocks() which does the
allocation ultimately ends up calling ext4_slice_branch if the inode
is using direct/indirect blocks instead of extents.
ext4_splice_branch() sets ctime.  Taking out the this line in
fs/ext4/inode.c:ext4_splice_branch() should fix things:

	/* We are done with atomic stuff, now do the rest of housekeeping */

-	inode->i_ctime = ext4_current_time(inode);
	ext4_mark_inode_dirty(handle, inode);

	/* had we spliced it onto indirect block? */

I'm pretty sure we don't need to set i_ctime anywhere else, since we
don't have a similar line in the extents code and we
fs/inode.c:file_update_time() should take care updating i_ctime where
it needs it, but I want to take a closer look to be sure.

   	     	   	   	  	 - Ted