Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

btrfs: don't print information about space cache or tree every remount

btrfs currently prints information about space cache or free space tree
being in use on every remount, regardless whether such remount actually
enabled or disabled one of these features.

This is actually unnecessary since providing remount options changing the
state of these features will explicitly print the appropriate notice.

Let's instead print such unconditional information just on an initial mount
to avoid filling the kernel log when, for example, laptop-mode-tools
remount the fs on some events.

Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Maciej S. Szmigiero and committed by
David Sterba
dbecac26 1fdbd03d

+7 -4
+7 -4
fs/btrfs/super.c
··· 626 626 int saved_compress_level; 627 627 bool saved_compress_force; 628 628 int no_compress = 0; 629 + const bool remounting = test_bit(BTRFS_FS_STATE_REMOUNTING, &info->fs_state); 629 630 630 631 if (btrfs_fs_compat_ro(info, FREE_SPACE_TREE)) 631 632 btrfs_set_opt(info->mount_opt, FREE_SPACE_TREE); ··· 1138 1137 } 1139 1138 if (!ret) 1140 1139 ret = btrfs_check_mountopts_zoned(info); 1141 - if (!ret && btrfs_test_opt(info, SPACE_CACHE)) 1142 - btrfs_info(info, "disk space caching is enabled"); 1143 - if (!ret && btrfs_test_opt(info, FREE_SPACE_TREE)) 1144 - btrfs_info(info, "using free space tree"); 1140 + if (!ret && !remounting) { 1141 + if (btrfs_test_opt(info, SPACE_CACHE)) 1142 + btrfs_info(info, "disk space caching is enabled"); 1143 + if (btrfs_test_opt(info, FREE_SPACE_TREE)) 1144 + btrfs_info(info, "using free space tree"); 1145 + } 1145 1146 return ret; 1146 1147 } 1147 1148