Skip to content

Commit c2c14ca

Browse files
bbkzzJaegeuk Kim
authored andcommitted
f2fs: set default compress option only when sb_has_compression
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> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent d11cef1 commit c2c14ca

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

fs/f2fs/super.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,10 +2072,12 @@ static void default_options(struct f2fs_sb_info *sbi)
20722072
F2FS_OPTION(sbi).fsync_mode = FSYNC_MODE_POSIX;
20732073
F2FS_OPTION(sbi).s_resuid = make_kuid(&init_user_ns, F2FS_DEF_RESUID);
20742074
F2FS_OPTION(sbi).s_resgid = make_kgid(&init_user_ns, F2FS_DEF_RESGID);
2075-
F2FS_OPTION(sbi).compress_algorithm = COMPRESS_LZ4;
2076-
F2FS_OPTION(sbi).compress_log_size = MIN_COMPRESS_LOG_SIZE;
2077-
F2FS_OPTION(sbi).compress_ext_cnt = 0;
2078-
F2FS_OPTION(sbi).compress_mode = COMPR_MODE_FS;
2075+
if (f2fs_sb_has_compression(sbi)) {
2076+
F2FS_OPTION(sbi).compress_algorithm = COMPRESS_LZ4;
2077+
F2FS_OPTION(sbi).compress_log_size = MIN_COMPRESS_LOG_SIZE;
2078+
F2FS_OPTION(sbi).compress_ext_cnt = 0;
2079+
F2FS_OPTION(sbi).compress_mode = COMPR_MODE_FS;
2080+
}
20792081
F2FS_OPTION(sbi).bggc_mode = BGGC_MODE_ON;
20802082
F2FS_OPTION(sbi).memory_mode = MEMORY_MODE_NORMAL;
20812083

0 commit comments

Comments
 (0)