]> git.ipfire.org Git - people/ms/linux.git/commit - fs/btrfs/super.c
btrfs: fix messages after changing compression level by remount
authorDavid Sterba <dsterba@suse.com>
Thu, 23 Jul 2020 17:08:55 +0000 (19:08 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 10 Aug 2020 16:58:16 +0000 (18:58 +0200)
commit27942c9971cc405c60432eca9395e514a2ae9f5e
tree0776582b0b1d3d3c751d94304f483738049a93e0
parentbf53d4687b8f3f6b752f091eb85f62369a515dfd
btrfs: fix messages after changing compression level by remount

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: David Sterba <dsterba@suse.com>
fs/btrfs/super.c