From: Zhang Yi <yi.zhang@huawei.com> hulk inclusion category: bugfix bugzilla: https://atomgit.com/openeuler/kernel/issues/8477 -------------------------------- 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(). Fixes: 5721968224e0 ("ext4: implement zero_range iomap path") Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Signed-off-by: Yongjian Sun <sunyongjian1@huawei.com> --- fs/ext4/extents.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index becaea5a327e..c992399b5106 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -4560,13 +4560,10 @@ static int ext4_alloc_file_blocks(struct file *file, loff_t offset, loff_t len, map.m_lblk += ret; map.m_len = len_lblk = len_lblk - ret; epos = (loff_t)map.m_lblk << inode->i_blkbits; - inode_set_ctime_current(inode); if (new_size) { if (epos > new_size) epos = new_size; - if (ext4_update_inode_size(inode, epos) & 0x1) - inode_set_mtime_to_ts(inode, - inode_get_ctime(inode)); + ext4_update_inode_size(inode, epos); if (epos > old_size) pagecache_isize_extended(inode, old_size, epos); } -- 2.39.2