Skip to content

Commit 396d0a2

Browse files
Yunlei HeJaegeuk Kim
authored andcommitted
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 <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 2724daf commit 396d0a2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

fs/f2fs/file.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2878,6 +2878,17 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in,
28782878
f2fs_up_write(&F2FS_I(dst)->i_gc_rwsem[WRITE]);
28792879
out_src:
28802880
f2fs_up_write(&F2FS_I(src)->i_gc_rwsem[WRITE]);
2881+
if (ret)
2882+
goto out_unlock;
2883+
2884+
src->i_mtime = src->i_ctime = current_time(src);
2885+
f2fs_mark_inode_dirty_sync(src, false);
2886+
if (src != dst) {
2887+
dst->i_mtime = dst->i_ctime = current_time(dst);
2888+
f2fs_mark_inode_dirty_sync(dst, false);
2889+
}
2890+
f2fs_update_time(sbi, REQ_TIME);
2891+
28812892
out_unlock:
28822893
if (src != dst)
28832894
inode_unlock(dst);

0 commit comments

Comments
 (0)