Skip to contentSkip to conversation

ext4: Don't update ctime for non-extent-mapped inodes

PATCH New Theodore Ts'o 1 participant 1 message Jun 15, 2009 ext4 file system

lore
Share & tools
lore

Theodore Ts'o

author maintainer
#0 lore raw

PATCH 1/1 ext4: Don't update ctime for non-extent-mapped inodes

The VFS handles updating ctime, so we don't need to update the inode's ctime in ext4_splace_branch() to update the direct or indirect blocks. This was harmless when we did this in ext3, but in ext4, thanks to delayed allocation, updating the ctime in ext4_splice_branch() can cause the ctime to mysteriously jump when the blocks are finally allocated.

Thanks to Björn Steinbrink for pointing out this problem on the git mailing list.

---
 fs/ext4/inode.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
fs/ext4/inode.c +0 -3
index 8d0908a..7c17ae2 100644
@@ -856,10 +856,6 @@ static int ext4_splice_branch(handle_t *handle, struct inode *inode,
 	}
 
 	/* 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);