Commit 41591750 authored by Theodore Ts'o's avatar Theodore Ts'o

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.
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent de9a55b8
...@@ -856,10 +856,6 @@ static int ext4_splice_branch(handle_t *handle, struct inode *inode, ...@@ -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 */ /* 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? */ /* had we spliced it onto indirect block? */
if (where->bh) { if (where->bh) {
/* /*
...@@ -878,8 +874,8 @@ static int ext4_splice_branch(handle_t *handle, struct inode *inode, ...@@ -878,8 +874,8 @@ static int ext4_splice_branch(handle_t *handle, struct inode *inode,
} else { } else {
/* /*
* OK, we spliced it into the inode itself on a direct block. * OK, we spliced it into the inode itself on a direct block.
* Inode was dirtied above.
*/ */
ext4_mark_inode_dirty(handle, inode);
jbd_debug(5, "splicing direct\n"); jbd_debug(5, "splicing direct\n");
} }
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment