From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Yunlei He <heyunlei@oppo.com>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/2 v2] f2fs: update mtime and ctime in move file range method
Date: Fri, 23 Jun 2023 11:55:35 -0700 [thread overview]
Message-ID: <ZJXqpw2Ckluo+20G@google.com> (raw)
In-Reply-To: <20230622161647.742012-1-heyunlei@oppo.com>
On 06/23, Yunlei He wrote:
> 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>
> ---
> v2:
> -update both src and dst inode
> fs/f2fs/file.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index cb42d8464ad9..e59fc8faa035 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -2886,6 +2886,19 @@ 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) {
Applied with minor change like:
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);
> --
> 2.40.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2023-06-23 18:55 UTC|newest]
Thread overview: 10+ 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 via Linux-f2fs-devel
2023-06-22 16:16 ` [f2fs-dev] [PATCH 2/2] f2fs: truncate pages if move file range success Yunlei He via Linux-f2fs-devel
2023-06-23 1:42 ` 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 [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-06-25 16:06 Yunlei He via Linux-f2fs-devel
2023-06-26 9:15 ` Chao Yu
2023-06-21 9:43 Yunlei He via Linux-f2fs-devel
2023-06-21 13:39 ` Chao Yu
2023-06-22 16:23 ` 何云蕾(Yunlei he) via Linux-f2fs-devel
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=ZJXqpw2Ckluo+20G@google.com \
--to=jaegeuk@kernel.org \
--cc=heyunlei@oppo.com \
--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;
as well as URLs for NNTP newsgroup(s).