git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Theodore Tso <tytso@mit.edu>
Date
Jun 5, 2009, 21:38 UTC
Message-ID
<20090605213824.GD6442@mit.edu>
In-Reply-To
<20090605183538.GE764@atjola.homenet>
On Fri, Jun 05, 2009 at 08:35:38PM +0200, Björn Steinbrink wrote:
Show 7 quoted lines
> > 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
Previous: Björn SteinbrinkNext: Linus Torvalds
Message 11 of 13 in “[BUG?] Working tree getting out of date "spontaneously"”
  1. Björn SteinbrinkJun 5, 2009
  2. Robin RosenbergJun 5, 2009
  3. Björn SteinbrinkJun 5, 2009
  4. Björn SteinbrinkJun 5, 2009
  5. Björn SteinbrinkJun 5, 2009
  6. Björn SteinbrinkJun 5, 2009
  7. Theodore TsoJun 5, 2009
  8. Björn SteinbrinkJun 5, 2009
  9. Theodore TsoJun 5, 2009
  10. Björn SteinbrinkJun 5, 2009
  11. Theodore TsoJun 5, 2009
  12. Linus TorvaldsJun 5, 2009
  13. Björn SteinbrinkJun 5, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.