2023-06-22 16:21:45

by Yunlei He

[permalink] [raw]
Subject: [f2fs-dev][PATCH 2/2] f2fs: truncate pages if move file range success

If move file range success, it should remove old data from
src and dst page cache.

Signed-off-by: Yunlei He <[email protected]>
---
fs/f2fs/file.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index e59fc8faa035..4bece7c56656 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -2896,6 +2896,9 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in,
f2fs_mark_inode_dirty_sync(dst, false);
}

+ truncate_pagecache_range(src, pos_in, pos_in + len - 1);
+ truncate_pagecache_range(dst, pos_out, pos_out + len - 1);
+
f2fs_update_time(sbi, REQ_TIME);
}

--
2.40.1



2023-06-23 02:30:41

by Chao Yu

[permalink] [raw]
Subject: Re: [f2fs-dev][PATCH 2/2] f2fs: truncate pages if move file range success

On 2023/6/23 0:16, Yunlei He wrote:
> If move file range success, it should remove old data from
> src and dst page cache.
>
> Signed-off-by: Yunlei He <[email protected]>

Reviewed-by: Chao Yu <[email protected]>

Thanks,