linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: set zstd default compression level to 3
@ 2023-06-07 16:29 Jaegeuk Kim
  2023-06-12 14:23 ` Chao Yu
  2023-06-12 15:17 ` [f2fs-dev] [PATCH] f2fs: set zstd default compression level to ZSTD_CLEVEL_DEFAULT Jaegeuk Kim
  0 siblings, 2 replies; 6+ messages in thread
From: Jaegeuk Kim @ 2023-06-07 16:29 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel; +Cc: Jaegeuk Kim

ZSTD does not support compress_level=0.

The commit d7ffafc99c42 ("f2fs: add sanity compress level check for compressed file")
revealed the issue.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 8fd23caa1ed9..1fb8d4f27a40 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -627,7 +627,7 @@ static int f2fs_set_zstd_level(struct f2fs_sb_info *sbi, const char *str)
 	int len = 4;
 
 	if (strlen(str) == len) {
-		F2FS_OPTION(sbi).compress_level = 0;
+		F2FS_OPTION(sbi).compress_level = 3;
 		return 0;
 	}
 
-- 
2.41.0.rc0.172.g3f132b7071-goog



_______________________________________________
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] 6+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: set zstd default compression level to 3
  2023-06-07 16:29 [f2fs-dev] [PATCH] f2fs: set zstd default compression level to 3 Jaegeuk Kim
@ 2023-06-12 14:23 ` Chao Yu
  2023-06-12 15:16   ` Jaegeuk Kim
  2023-06-12 15:17 ` [f2fs-dev] [PATCH] f2fs: set zstd default compression level to ZSTD_CLEVEL_DEFAULT Jaegeuk Kim
  1 sibling, 1 reply; 6+ messages in thread
From: Chao Yu @ 2023-06-12 14:23 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-kernel, linux-f2fs-devel

On 2023/6/8 0:29, Jaegeuk Kim wrote:
> ZSTD does not support compress_level=0.

IIUC, it looks the range is [0, ZSTD_MAX_CLEVEL], 0 equals to default
(ZSTD_CLEVEL_DEFAULT).

zstd_compress.c

     /* row */
     if (compressionLevel == 0) row = ZSTD_CLEVEL_DEFAULT;   /* 0 == default */
     else if (compressionLevel < 0) row = 0;   /* entry 0 is baseline for fast mode */
     else if (compressionLevel > ZSTD_MAX_CLEVEL) row = ZSTD_MAX_CLEVEL;
     else row = compressionLevel;

Thanks,

> 
> The commit d7ffafc99c42 ("f2fs: add sanity compress level check for compressed file")
> revealed the issue.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>   fs/f2fs/super.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 8fd23caa1ed9..1fb8d4f27a40 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -627,7 +627,7 @@ static int f2fs_set_zstd_level(struct f2fs_sb_info *sbi, const char *str)
>   	int len = 4;
>   
>   	if (strlen(str) == len) {
> -		F2FS_OPTION(sbi).compress_level = 0;
> +		F2FS_OPTION(sbi).compress_level = 3;
>   		return 0;
>   	}
>   


_______________________________________________
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] 6+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: set zstd default compression level to 3
  2023-06-12 14:23 ` Chao Yu
@ 2023-06-12 15:16   ` Jaegeuk Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Jaegeuk Kim @ 2023-06-12 15:16 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-kernel, linux-f2fs-devel

On 06/12, Chao Yu wrote:
> On 2023/6/8 0:29, Jaegeuk Kim wrote:
> > ZSTD does not support compress_level=0.
> 
> IIUC, it looks the range is [0, ZSTD_MAX_CLEVEL], 0 equals to default
> (ZSTD_CLEVEL_DEFAULT).

Ok, that seems a quick workaround of zstd, since it'd be quite hard to know
level=0 will be interpreted to whatever default behind the scenes.

> 
> zstd_compress.c
> 
>     /* row */
>     if (compressionLevel == 0) row = ZSTD_CLEVEL_DEFAULT;   /* 0 == default */
>     else if (compressionLevel < 0) row = 0;   /* entry 0 is baseline for fast mode */
>     else if (compressionLevel > ZSTD_MAX_CLEVEL) row = ZSTD_MAX_CLEVEL;
>     else row = compressionLevel;
> 
> Thanks,
> 
> > 
> > The commit d7ffafc99c42 ("f2fs: add sanity compress level check for compressed file")
> > revealed the issue.
> > 
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> >   fs/f2fs/super.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> > index 8fd23caa1ed9..1fb8d4f27a40 100644
> > --- a/fs/f2fs/super.c
> > +++ b/fs/f2fs/super.c
> > @@ -627,7 +627,7 @@ static int f2fs_set_zstd_level(struct f2fs_sb_info *sbi, const char *str)
> >   	int len = 4;
> >   	if (strlen(str) == len) {
> > -		F2FS_OPTION(sbi).compress_level = 0;
> > +		F2FS_OPTION(sbi).compress_level = 3;
> >   		return 0;
> >   	}


_______________________________________________
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] 6+ messages in thread

* [f2fs-dev] [PATCH] f2fs: set zstd default compression level to ZSTD_CLEVEL_DEFAULT
  2023-06-07 16:29 [f2fs-dev] [PATCH] f2fs: set zstd default compression level to 3 Jaegeuk Kim
  2023-06-12 14:23 ` Chao Yu
@ 2023-06-12 15:17 ` Jaegeuk Kim
  2023-06-13  0:45   ` Chao Yu
  1 sibling, 1 reply; 6+ messages in thread
From: Jaegeuk Kim @ 2023-06-12 15:17 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel

ZSTD does not support compress_level=0.

The commit d7ffafc99c42 ("f2fs: add sanity compress level check for compressed file")
started to complain this.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
Change log from v1:
 - use default macro

 fs/f2fs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 8fd23caa1ed9..ce3b628b5072 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -627,7 +627,7 @@ static int f2fs_set_zstd_level(struct f2fs_sb_info *sbi, const char *str)
 	int len = 4;
 
 	if (strlen(str) == len) {
-		F2FS_OPTION(sbi).compress_level = 0;
+		F2FS_OPTION(sbi).compress_level = ZSTD_CLEVEL_DEFAULT;
 		return 0;
 	}
 
-- 
2.41.0.162.gfafddb0af9-goog



_______________________________________________
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] 6+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: set zstd default compression level to ZSTD_CLEVEL_DEFAULT
  2023-06-12 15:17 ` [f2fs-dev] [PATCH] f2fs: set zstd default compression level to ZSTD_CLEVEL_DEFAULT Jaegeuk Kim
@ 2023-06-13  0:45   ` Chao Yu
  2023-06-13 20:54     ` Jaegeuk Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Chao Yu @ 2023-06-13  0:45 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-kernel, linux-f2fs-devel

On 2023/6/12 23:17, Jaegeuk Kim wrote:
> ZSTD does not support compress_level=0.
> 
> The commit d7ffafc99c42 ("f2fs: add sanity compress level check for compressed file")
> started to complain this.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,


_______________________________________________
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] 6+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: set zstd default compression level to ZSTD_CLEVEL_DEFAULT
  2023-06-13  0:45   ` Chao Yu
@ 2023-06-13 20:54     ` Jaegeuk Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Jaegeuk Kim @ 2023-06-13 20:54 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-kernel, linux-f2fs-devel

On 06/13, Chao Yu wrote:
> On 2023/6/12 23:17, Jaegeuk Kim wrote:
> > ZSTD does not support compress_level=0.
> > 
> > The commit d7ffafc99c42 ("f2fs: add sanity compress level check for compressed file")
> > started to complain this.
> > 
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> 
> Reviewed-by: Chao Yu <chao@kernel.org>

Final version:
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev-test&id=e59031a552b5cbda098a7ee421ec56bd084dfd4d

> 
> Thanks,


_______________________________________________
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] 6+ messages in thread

end of thread, other threads:[~2023-06-13 20:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-07 16:29 [f2fs-dev] [PATCH] f2fs: set zstd default compression level to 3 Jaegeuk Kim
2023-06-12 14:23 ` Chao Yu
2023-06-12 15:16   ` Jaegeuk Kim
2023-06-12 15:17 ` [f2fs-dev] [PATCH] f2fs: set zstd default compression level to ZSTD_CLEVEL_DEFAULT Jaegeuk Kim
2023-06-13  0:45   ` Chao Yu
2023-06-13 20:54     ` Jaegeuk Kim

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