Skip to contentSkip to conversation

f2fs compression level not actually set when using zstd compression?

f2fs-dev 5kft 2 participants 2 messages Jul 9, 2021 – Jul 10, 2021

lore
Share & tools
lore

5kft

author
#0 lore raw

It appears that the logic in "set_compress_context" (in https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/tree/fs/f2fs/f2fs.h, line 4021) does not actually set the compression level in the inode for zstd compression - it only sets it for lz4:

    if (F2FS_I(inode)->i_compress_algorithm == COMPRESS_LZ4 &&
             F2FS_OPTION(sbi).compress_level)
         F2FS_I(inode)->i_compress_flag |=
                  F2FS_OPTION(sbi).compress_level <<
                  COMPRESS_LEVEL_OFFSET;

Shouldn't this condition include "F2FS_I(inode)->i_compress_algorithm == COMPRESS_ZSTD" as part of the condition as well?

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#1 lore raw

Hello,

Quoted 9 lines · On 2021/7/10 0:52, 5kft wrote:

It appears that the logic in "set_compress_context" (in https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/tree/fs/f2fs/f2fs.h, line 4021) does not actually set the compression level in the inode for zstd compression - it only sets it for lz4:

     if (F2FS_I(inode)->i_compress_algorithm == COMPRESS_LZ4 &&
              F2FS_OPTION(sbi).compress_level)
          F2FS_I(inode)->i_compress_flag |=
                   F2FS_OPTION(sbi).compress_level <<
                   COMPRESS_LEVEL_OFFSET;

Shouldn't this condition include "F2FS_I(inode)->i_compress_algorithm == COMPRESS_ZSTD" as part of the condition as well?

You're correct and it's a good catch, I've made a patch to fix this issue.

Thanks a lot for the report!

Thanks,

Quoted 7 lines

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel