From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: set zstd default compression level to 3
Date: Mon, 12 Jun 2023 08:16:17 -0700 [thread overview]
Message-ID: <ZIc2wa2ZRLQ/Q8LE@google.com> (raw)
In-Reply-To: <85ff67e0-c6c6-e693-bcba-6e36a3dd2ea4@kernel.org>
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
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: set zstd default compression level to 3
Date: Mon, 12 Jun 2023 08:16:17 -0700 [thread overview]
Message-ID: <ZIc2wa2ZRLQ/Q8LE@google.com> (raw)
In-Reply-To: <85ff67e0-c6c6-e693-bcba-6e36a3dd2ea4@kernel.org>
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;
> > }
next prev parent reply other threads:[~2023-06-12 15:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-07 16:29 [f2fs-dev] [PATCH] f2fs: set zstd default compression level to 3 Jaegeuk Kim
2023-06-07 16:29 ` Jaegeuk Kim
2023-06-12 14:23 ` [f2fs-dev] " Chao Yu
2023-06-12 14:23 ` Chao Yu
2023-06-12 15:16 ` Jaegeuk Kim [this message]
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-12 15:17 ` Jaegeuk Kim
2023-06-13 0:45 ` [f2fs-dev] " Chao Yu
2023-06-13 0:45 ` Chao Yu
2023-06-13 20:54 ` Jaegeuk Kim
2023-06-13 20:54 ` Jaegeuk Kim
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=ZIc2wa2ZRLQ/Q8LE@google.com \
--to=jaegeuk@kernel.org \
--cc=chao@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.