• Marcos Paulo de Souza's avatar
    btrfs: reset compression level for lzo on remount · 282dd7d7
    Marcos Paulo de Souza authored
    Currently a user can set mount "-o compress" which will set the
    compression algorithm to zlib, and use the default compress level for
    zlib (3):
    
      relatime,compress=zlib:3,space_cache
    
    If the user remounts the fs using "-o compress=lzo", then the old
    compress_level is used:
    
      relatime,compress=lzo:3,space_cache
    
    But lzo does not expose any tunable compression level. The same happens
    if we set any compress argument with different level, also with zstd.
    
    Fix this by resetting the compress_level when compress=lzo is
    specified.  With the fix applied, lzo is shown without compress level:
    
      relatime,compress=lzo,space_cache
    
    CC: stable@vger.kernel.org # 4.4+
    Signed-off-by: default avatarMarcos Paulo de Souza <mpdesouza@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    282dd7d7
super.c 68.7 KB