linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND] f2fs: set default compress option only when sb_has_compression
@ 2023-03-30 16:56 Yangtao Li
  2023-04-05  2:51 ` Chao Yu
  2023-04-05 16:20 ` [f2fs-dev] " patchwork-bot+f2fs
  0 siblings, 2 replies; 3+ messages in thread
From: Yangtao Li @ 2023-03-30 16:56 UTC (permalink / raw)
  To: Jaegeuk Kim, Chao Yu; +Cc: Yangtao Li, linux-f2fs-devel, linux-kernel

If the compress feature is not enabled, there is no need to set
compress-related parameters.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/f2fs/super.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 768be1c76a47..b5828a67f7c1 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2073,10 +2073,12 @@ static void default_options(struct f2fs_sb_info *sbi)
 	F2FS_OPTION(sbi).fsync_mode = FSYNC_MODE_POSIX;
 	F2FS_OPTION(sbi).s_resuid = make_kuid(&init_user_ns, F2FS_DEF_RESUID);
 	F2FS_OPTION(sbi).s_resgid = make_kgid(&init_user_ns, F2FS_DEF_RESGID);
-	F2FS_OPTION(sbi).compress_algorithm = COMPRESS_LZ4;
-	F2FS_OPTION(sbi).compress_log_size = MIN_COMPRESS_LOG_SIZE;
-	F2FS_OPTION(sbi).compress_ext_cnt = 0;
-	F2FS_OPTION(sbi).compress_mode = COMPR_MODE_FS;
+	if (f2fs_sb_has_compression(sbi)) {
+		F2FS_OPTION(sbi).compress_algorithm = COMPRESS_LZ4;
+		F2FS_OPTION(sbi).compress_log_size = MIN_COMPRESS_LOG_SIZE;
+		F2FS_OPTION(sbi).compress_ext_cnt = 0;
+		F2FS_OPTION(sbi).compress_mode = COMPR_MODE_FS;
+	}
 	F2FS_OPTION(sbi).bggc_mode = BGGC_MODE_ON;
 	F2FS_OPTION(sbi).memory_mode = MEMORY_MODE_NORMAL;
 
-- 
2.35.1


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

* Re: [RESEND] f2fs: set default compress option only when sb_has_compression
  2023-03-30 16:56 [RESEND] f2fs: set default compress option only when sb_has_compression Yangtao Li
@ 2023-04-05  2:51 ` Chao Yu
  2023-04-05 16:20 ` [f2fs-dev] " patchwork-bot+f2fs
  1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu @ 2023-04-05  2:51 UTC (permalink / raw)
  To: Yangtao Li, Jaegeuk Kim; +Cc: linux-f2fs-devel, linux-kernel

On 2023/3/31 0:56, Yangtao Li wrote:
> If the compress feature is not enabled, there is no need to set
> compress-related parameters.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Patch looks fine, but it's better to fix similar issues in one
patch.

e.g.
f2fs: add compression feature check for all compress mount opt

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

Thanks,

> ---
>   fs/f2fs/super.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 768be1c76a47..b5828a67f7c1 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -2073,10 +2073,12 @@ static void default_options(struct f2fs_sb_info *sbi)
>   	F2FS_OPTION(sbi).fsync_mode = FSYNC_MODE_POSIX;
>   	F2FS_OPTION(sbi).s_resuid = make_kuid(&init_user_ns, F2FS_DEF_RESUID);
>   	F2FS_OPTION(sbi).s_resgid = make_kgid(&init_user_ns, F2FS_DEF_RESGID);
> -	F2FS_OPTION(sbi).compress_algorithm = COMPRESS_LZ4;
> -	F2FS_OPTION(sbi).compress_log_size = MIN_COMPRESS_LOG_SIZE;
> -	F2FS_OPTION(sbi).compress_ext_cnt = 0;
> -	F2FS_OPTION(sbi).compress_mode = COMPR_MODE_FS;
> +	if (f2fs_sb_has_compression(sbi)) {
> +		F2FS_OPTION(sbi).compress_algorithm = COMPRESS_LZ4;
> +		F2FS_OPTION(sbi).compress_log_size = MIN_COMPRESS_LOG_SIZE;
> +		F2FS_OPTION(sbi).compress_ext_cnt = 0;
> +		F2FS_OPTION(sbi).compress_mode = COMPR_MODE_FS;
> +	}
>   	F2FS_OPTION(sbi).bggc_mode = BGGC_MODE_ON;
>   	F2FS_OPTION(sbi).memory_mode = MEMORY_MODE_NORMAL;
>   

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

* Re: [f2fs-dev] [RESEND] f2fs: set default compress option only when sb_has_compression
  2023-03-30 16:56 [RESEND] f2fs: set default compress option only when sb_has_compression Yangtao Li
  2023-04-05  2:51 ` Chao Yu
@ 2023-04-05 16:20 ` patchwork-bot+f2fs
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+f2fs @ 2023-04-05 16:20 UTC (permalink / raw)
  To: Yangtao Li; +Cc: jaegeuk, chao, linux-f2fs-devel, linux-kernel

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:

On Fri, 31 Mar 2023 00:56:48 +0800 you wrote:
> If the compress feature is not enabled, there is no need to set
> compress-related parameters.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  fs/f2fs/super.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

Here is the summary with links:
  - [f2fs-dev,RESEND] f2fs: set default compress option only when sb_has_compression
    https://git.kernel.org/jaegeuk/f2fs/c/338abb312bb2

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-04-05 16:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30 16:56 [RESEND] f2fs: set default compress option only when sb_has_compression Yangtao Li
2023-04-05  2:51 ` Chao Yu
2023-04-05 16:20 ` [f2fs-dev] " patchwork-bot+f2fs

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