Skip to content

Commit 116c0bd

Browse files
zhangyi089tytso
authored andcommitted
ext4: remove ctime/mtime update from ext4_alloc_file_blocks()
The ctime and mtime update is already handled by file_modified() in ext4_fallocate(), the caller of ext4_alloc_file_blocks(). So remove the redundant calls to inode_set_ctime_current() and inode_set_mtime_to_ts() in ext4_alloc_file_blocks(). Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20260327102939.1095257-12-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent c3688d2 commit 116c0bd

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

fs/ext4/extents.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4652,13 +4652,10 @@ static int ext4_alloc_file_blocks(struct file *file, loff_t offset, loff_t len,
46524652
*/
46534653
retries = 0;
46544654
epos = EXT4_LBLK_TO_B(inode, map.m_lblk + ret);
4655-
inode_set_ctime_current(inode);
46564655
if (new_size) {
46574656
if (epos > new_size)
46584657
epos = new_size;
4659-
if (ext4_update_inode_size(inode, epos) & 0x1)
4660-
inode_set_mtime_to_ts(inode,
4661-
inode_get_ctime(inode));
4658+
ext4_update_inode_size(inode, epos);
46624659
if (epos > old_size)
46634660
pagecache_isize_extended(inode, old_size, epos);
46644661
}

0 commit comments

Comments
 (0)