mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yunlei He <heyunlei@oppo.com>
To: jaegeuk@kernel.org, chao@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Yunlei He <heyunlei@oppo.com>
Subject: [f2fs-dev][PATCH 2/2]  f2fs: truncate pages if move file range success
Date: Fri, 23 Jun 2023 00:16:47 +0800	[thread overview]
Message-ID: <20230622161647.742012-2-heyunlei@oppo.com> (raw)
In-Reply-To: <20230622161647.742012-1-heyunlei@oppo.com>

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

Signed-off-by: Yunlei He <heyunlei@oppo.com>
---
 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


  reply	other threads:[~2023-06-22 16:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22 16:16 [f2fs-dev][PATCH 1/2 v2] f2fs: update mtime and ctime in move file range method Yunlei He
2023-06-22 16:16 ` Yunlei He [this message]
2023-06-23  1:42   ` [f2fs-dev][PATCH 2/2] f2fs: truncate pages if move file range success Chao Yu
2023-06-23  1:42 ` [f2fs-dev][PATCH 1/2 v2] f2fs: update mtime and ctime in move file range method Chao Yu
2023-06-23 18:55 ` Jaegeuk Kim
  -- strict thread matches above, loose matches on Subject: below --
2023-06-21  9:43 Yunlei He
2023-06-21  9:43 ` [f2fs-dev][PATCH 2/2] f2fs: truncate pages if move file range success Yunlei He
2023-06-21 13:41   ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230622161647.742012-2-heyunlei@oppo.com \
    --to=heyunlei@oppo.com \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®