From: changfengnan--- via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: "'Chao Yu'" <yuchao0@huawei.com>, <jaegeuk@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] 答复: 答复: [RFC PATCH] f2fs: compress: remove unneeded read when rewrite whole cluster
Date: Tue, 8 Jun 2021 20:47:43 +0800 [thread overview]
Message-ID: <01ec01d75c64$797f7480$6c7e5d80$@vivo.com> (raw)
In-Reply-To: <e7655a1d-9c59-36d6-a4c1-225a293d5cc7@huawei.com>
Hi Jaegeuk:
Any comments about this patch?
Thanks.
-----邮件原件-----
发件人: Chao Yu <yuchao0@huawei.com>
发送时间: 2021年5月29日 9:13
收件人: changfengnan@vivo.com; jaegeuk@kernel.org
抄送: linux-f2fs-devel@lists.sourceforge.net
主题: Re: [f2fs-dev] 答复: [RFC PATCH] f2fs: compress: remove unneeded read
when rewrite whole cluster
On 2021/5/28 10:49, Chao Yu wrote:
> On 2021/5/25 20:05, changfengnan@vivo.com wrote:
>> yes, I just check wheather the whole page was dirty, because of when
>> write cache f2fs_prepare_compress_overwrite will be called again,
>> when update whole cluster, cc in prepare_compress_overwrite will be
>> empty, so will not submit bio.
>> when only update one page in cluster, cc in
>> prepare_compress_overwrite will not be empty, so will submit bio.
>> This is my thinking, not sure if I've missed anything
>
> Well, it looks more like we did for mmap() write case.
>
> So I guess we can change as below:
>
> To Jaegeuk, comments?
>
> ---
> fs/f2fs/data.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index
> 2ea887a114c8..723c59df51b7 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -3323,7 +3323,7 @@ static int f2fs_write_begin(struct file *file,
struct address_space *mapping,
> }
>
> #ifdef CONFIG_F2FS_FS_COMPRESSION
> - if (f2fs_compressed_file(inode)) {
> + if (f2fs_compressed_file(inode) && len != PAGE_SIZE) {
It will cause panic in f2fs_write_end() due to miss to assign fsdata with
NULL, updated as below:
---
fs/f2fs/data.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index
2ea887a114c8..4e214ac87925 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3328,6 +3328,9 @@ static int f2fs_write_begin(struct file *file, struct
address_space *mapping,
*fsdata = NULL;
+ if (len == PAGE_SIZE)
+ goto repeat;
+
ret = f2fs_prepare_compress_overwrite(inode, pagep,
index, fsdata);
if (ret < 0) {
--
2.29.2
Thanks,
> int ret;
>
> *fsdata = NULL;
>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
prev parent reply other threads:[~2021-06-08 12:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-18 12:51 [f2fs-dev] [RFC PATCH] f2fs: compress: remove unneeded read when rewrite whole cluster Fengnan Chang
2021-05-21 8:38 ` [f2fs-dev] 答复: " changfengnan
2021-05-24 11:38 ` [f2fs-dev] " Chao Yu
2021-05-25 12:05 ` [f2fs-dev] 答复: " changfengnan
2021-05-28 2:49 ` Chao Yu
2021-05-29 1:13 ` Chao Yu
2021-06-08 12:47 ` changfengnan--- via Linux-f2fs-devel [this message]
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='01ec01d75c64$797f7480$6c7e5d80$@vivo.com' \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=changfengnan@vivo.com \
--cc=jaegeuk@kernel.org \
--cc=yuchao0@huawei.com \
/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).