btrfs: fix printing of mount info messages for NODATACOW/NODATASUM
authorKyoji Ogasawara <sawara04.o@gmail.com>
Tue, 12 Aug 2025 18:00:07 +0000 (03:00 +0900)
committerDavid Sterba <dsterba@suse.com>
Wed, 13 Aug 2025 12:08:58 +0000 (14:08 +0200)
The NODATASUM message was printed twice by mistake and the NODATACOW was
missing from the 'unset' part.  Fix the duplication and make the output
look the same.

Fixes: eddb1a433f26 ("btrfs: add reconfigure callback for fs_context")
CC: stable@vger.kernel.org # 6.8+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Kyoji Ogasawara <sawara04.o@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/super.c

index 8469f36ef0117d50e87ba1f0fda7a25e9ebff15b..7f31f8bd63ba4db3a1258575a7f5c959462d9384 100644 (file)
@@ -1439,7 +1439,7 @@ static void btrfs_emit_options(struct btrfs_fs_info *info,
 {
        btrfs_info_if_set(info, old, NODATASUM, "setting nodatasum");
        btrfs_info_if_set(info, old, DEGRADED, "allowing degraded mounts");
-       btrfs_info_if_set(info, old, NODATASUM, "setting nodatasum");
+       btrfs_info_if_set(info, old, NODATACOW, "setting nodatacow");
        btrfs_info_if_set(info, old, SSD, "enabling ssd optimizations");
        btrfs_info_if_set(info, old, SSD_SPREAD, "using spread ssd allocation scheme");
        btrfs_info_if_set(info, old, NOBARRIER, "turning off barriers");
@@ -1461,6 +1461,7 @@ static void btrfs_emit_options(struct btrfs_fs_info *info,
        btrfs_info_if_set(info, old, IGNOREMETACSUMS, "ignoring meta csums");
        btrfs_info_if_set(info, old, IGNORESUPERFLAGS, "ignoring unknown super block flags");
 
+       btrfs_info_if_unset(info, old, NODATASUM, "setting datasum");
        btrfs_info_if_unset(info, old, NODATACOW, "setting datacow");
        btrfs_info_if_unset(info, old, SSD, "not using ssd optimizations");
        btrfs_info_if_unset(info, old, SSD_SPREAD, "not using spread ssd allocation scheme");