linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: compress: don't compress any datas after cp stop
@ 2020-05-26  1:55 Chao Yu
  2020-05-28  2:46 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Chao Yu @ 2020-05-26  1:55 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

While compressed data writeback, we need to drop dirty pages like we did
for non-compressed pages if cp stops, however it's not needed to compress
any data in such case, so let's detect cp stop condition in
cluster_may_compress() to avoid redundant compressing and let following
f2fs_write_raw_pages() drops dirty pages correctly.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
 fs/f2fs/compress.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index bf152c0d79fe..a53578a89211 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -849,6 +849,8 @@ static bool cluster_may_compress(struct compress_ctx *cc)
 		return false;
 	if (!f2fs_cluster_is_full(cc))
 		return false;
+	if (unlikely(f2fs_cp_error(F2FS_I_SB(cc->inode))))
+		return false;
 	return __cluster_may_compress(cc);
 }
 
-- 
2.18.0.rc1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: compress: don't compress any datas after cp stop
  2020-05-26  1:55 [f2fs-dev] [PATCH] f2fs: compress: don't compress any datas after cp stop Chao Yu
@ 2020-05-28  2:46 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2020-05-28  2:46 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

Jaegeuk, could you please review this patch?

On 2020/5/26 9:55, Chao Yu wrote:
> While compressed data writeback, we need to drop dirty pages like we did
> for non-compressed pages if cp stops, however it's not needed to compress
> any data in such case, so let's detect cp stop condition in
> cluster_may_compress() to avoid redundant compressing and let following
> f2fs_write_raw_pages() drops dirty pages correctly.
> 
> Signed-off-by: Chao Yu <yuchao0@huawei.com>
> ---
>  fs/f2fs/compress.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
> index bf152c0d79fe..a53578a89211 100644
> --- a/fs/f2fs/compress.c
> +++ b/fs/f2fs/compress.c
> @@ -849,6 +849,8 @@ static bool cluster_may_compress(struct compress_ctx *cc)
>  		return false;
>  	if (!f2fs_cluster_is_full(cc))
>  		return false;
> +	if (unlikely(f2fs_cp_error(F2FS_I_SB(cc->inode))))
> +		return false;
>  	return __cluster_may_compress(cc);
>  }
>  
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-28  2:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26  1:55 [f2fs-dev] [PATCH] f2fs: compress: don't compress any datas after cp stop Chao Yu
2020-05-28  2:46 ` Chao Yu

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).