lkml.org 
[lkml]   [2023]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[f2fs-dev][PATCH] f2fs: update mtime and ctime in move file range method
Date
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>
---
fs/f2fs/file.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 34a6177c64a4..81e4b85fe805 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -2881,6 +2881,13 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in,

if (src != dst)
f2fs_up_write(&F2FS_I(dst)->i_gc_rwsem[WRITE]);
+
+ if (!ret) {
+ dst->i_mtime = dst->i_ctime = current_time(dst);
+ f2fs_mark_inode_dirty_sync(dst, false);
+ f2fs_update_time(F2FS_I_SB(dst), REQ_TIME);
+ }
+
out_src:
f2fs_up_write(&F2FS_I(src)->i_gc_rwsem[WRITE]);
out_unlock:
--
2.40.1
\
 
 \ /
  Last update: 2023-06-19 16:36    [W:0.035 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site