diff options
| author | Zhang Yi <yi.zhang@huawei.com> | 2026-03-27 13:29:37 +0300 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2026-04-10 04:57:52 +0300 |
| commit | 116c0bdac2ec059d91045ba3f57cc90cb1e3b71d (patch) | |
| tree | 0765b2bf64d07821b9a14b631ad6a1deb7b6028a | |
| parent | c3688d212fc6306bbb7136fbc1d0be0f175a5270 (diff) | |
| download | linux-116c0bdac2ec059d91045ba3f57cc90cb1e3b71d.tar.xz | |
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>
| -rw-r--r-- | fs/ext4/extents.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 053aeb9f0e74..4e7e798a5e49 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -4652,13 +4652,10 @@ retry: */ retries = 0; epos = EXT4_LBLK_TO_B(inode, map.m_lblk + ret); - 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); } |
