• David Sterba's avatar
    btrfs: fix messages after changing compression level by remount · 7c1ddfc9
    David Sterba authored
    commit 27942c99 upstream.
    
    Reported by Forza on IRC that remounting with compression options does
    not reflect the change in level, or at least it does not appear to do so
    according to the messages:
    
      mount -o compress=zstd:1 /dev/sda /mnt
      mount -o remount,compress=zstd:15 /mnt
    
    does not print the change to the level to syslog:
    
      [   41.366060] BTRFS info (device vda): use zstd compression, level 1
      [   41.368254] BTRFS info (device vda): disk space caching is enabled
      [   41.390429] BTRFS info (device vda): disk space caching is enabled
    
    What really happens is that the message is lost but the level is actualy
    changed.
    
    There's another weird output, if compression is reset to 'no':
    
      [   45.413776] BTRFS info (device vda): use no compression, level 4
    
    To fix that, save the previous compression level and print the message
    in that case too and use separate message for 'no' compression.
    
    CC: stable@vger.kernel.org # 4.19+
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    7c1ddfc9
super.c 66 KB