]> www.infradead.org Git - linux.git/commitdiff
btrfs: emit a warning about space cache v1 being deprecated
authorJosef Bacik <josef@toxicpanda.com>
Mon, 29 Jul 2024 15:05:48 +0000 (11:05 -0400)
committerDavid Sterba <dsterba@suse.com>
Thu, 1 Aug 2024 15:30:50 +0000 (17:30 +0200)
We've been wanting to get rid of this for a while, add a message to
indicate that this feature is going away and when so we can finally have
a date when we're going to remove it.  The output looks like this

BTRFS warning (device nvme0n1): space cache v1 is being deprecated and will be removed in a future release, please use -o space_cache=v2

Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/super.c

index 08d33cb372fbcb55d2e33388314cd1e78961b6eb..83478deada3bd25bf1cd44c2aaed98756b35dea7 100644 (file)
@@ -683,8 +683,11 @@ bool btrfs_check_options(const struct btrfs_fs_info *info,
                ret = false;
 
        if (!test_bit(BTRFS_FS_STATE_REMOUNTING, &info->fs_state)) {
-               if (btrfs_raw_test_opt(*mount_opt, SPACE_CACHE))
+               if (btrfs_raw_test_opt(*mount_opt, SPACE_CACHE)) {
                        btrfs_info(info, "disk space caching is enabled");
+                       btrfs_warn(info,
+"space cache v1 is being deprecated and will be removed in a future release, please use -o space_cache=v2");
+               }
                if (btrfs_raw_test_opt(*mount_opt, FREE_SPACE_TREE))
                        btrfs_info(info, "using free-space-tree");
        }