Skip to content

Commit

Permalink
f2fs: update mtime and ctime in move file range method
Browse files Browse the repository at this point in the history
Mtime and ctime stay old value without update after move
file range ioctl. This patch add time update.

Signed-off-by: Yunlei He <[email protected]>
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
  • Loading branch information
Yunlei He authored and Jaegeuk Kim committed Jun 26, 2023
1 parent b9f0283 commit e9e46cd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions fs/f2fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2917,6 +2917,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);
Expand Down

0 comments on commit e9e46cd

Please sign in to comment.