From f5e07cc60a8fafc2ab4f999edc7cb6f3be8bca0b Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 20 Oct 2022 16:36:10 +0200 Subject: [PATCH] btrfs-progs: warn when an experimental functionality is used Print warning when one of the following is requested by some command line option: - btrfstune -b: conversion to block-group-tree - mkfs.btrfs --num-global-roots: extent-tree-v2 - btrfs-image -d: dump image with data Issue: #523 Signed-off-by: David Sterba --- btrfstune.c | 5 +++-- image/main.c | 1 + mkfs/main.c | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/btrfstune.c b/btrfstune.c index 476f4681..afa4cc97 100644 --- a/btrfstune.c +++ b/btrfstune.c @@ -966,7 +966,7 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) break; switch(c) { case 'b': - btrfs_warn_experimental("Feature: block-group-tree"); + btrfs_warn_experimental("Feature: conversion to block-group-tree"); to_bg_tree = true; break; case 'S': @@ -1004,9 +1004,10 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) break; #if EXPERIMENTAL case GETOPT_VAL_CSUM: + btrfs_warn_experimental( + "Switching checksums is experimental, do not use for valuable data!"); ctree_flags |= OPEN_CTREE_SKIP_CSUM_CHECK; csum_type = parse_csum_type(optarg); - warning("Switching checksums is experimental, do not use for valuable data!"); printf("Switch csum to %s\n", btrfs_super_csum_name(csum_type)); break; diff --git a/image/main.c b/image/main.c index de5aa736..b1a0714a 100644 --- a/image/main.c +++ b/image/main.c @@ -3109,6 +3109,7 @@ int BOX_MAIN(image)(int argc, char *argv[]) multi_devices = 1; break; case 'd': + btrfs_warn_experimental("Feature: dump image with data"); dump_data = true; break; case GETOPT_VAL_HELP: diff --git a/mkfs/main.c b/mkfs/main.c index c4a4e198..df091b16 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -1188,6 +1188,7 @@ int BOX_MAIN(mkfs)(int argc, char **argv) csum_type = parse_csum_type(optarg); break; case GETOPT_VAL_GLOBAL_ROOTS: + btrfs_warn_experimental("Feature: num-global-roots is part of exten-tree-v2"); nr_global_roots = (int)arg_strtou64(optarg); break; case GETOPT_VAL_HELP: