diff options
author | Yunlei He <heyunlei@oppo.com> | 2023-06-23 00:16:46 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2023-06-26 06:21:42 -0700 |
commit | 396d0a28836d42bef595a8843533285abaf64ff7 (patch) | |
tree | 82c99a7b1f9c9d544aa1973553054b783b9c0248 /fs | |
parent | 2724daf6c24c58099a758d1e842d39b10133b065 (diff) | |
download | linux-stable-396d0a28836d42bef595a8843533285abaf64ff7.tar.gz linux-stable-396d0a28836d42bef595a8843533285abaf64ff7.tar.bz2 linux-stable-396d0a28836d42bef595a8843533285abaf64ff7.zip |
f2fs: update mtime and ctime in move file range method
Mtime and ctime stay old value without update after move
file range ioctl. This patch add time update.
Signed-off-by: Yunlei He <heyunlei@oppo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/file.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 12ad128aefb7..fd2cde9d21b0 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2878,6 +2878,17 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in, f2fs_up_write(&F2FS_I(dst)->i_gc_rwsem[WRITE]); out_src: f2fs_up_write(&F2FS_I(src)->i_gc_rwsem[WRITE]); + if (ret) + goto out_unlock; + + src->i_mtime = src->i_ctime = current_time(src); + f2fs_mark_inode_dirty_sync(src, false); + if (src != dst) { + dst->i_mtime = dst->i_ctime = current_time(dst); + f2fs_mark_inode_dirty_sync(dst, false); + } + f2fs_update_time(sbi, REQ_TIME); + out_unlock: if (src != dst) inode_unlock(dst); |