]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson, common: switch bs_rocksdb_cf validator to strict_strtob(). 35750/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 24 Jun 2020 13:40:53 +0000 (13:40 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 24 Jun 2020 14:20:15 +0000 (14:20 +0000)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/common/options.cc

index e4b58f6b1e89bb97f500469241a9da4ca4357b24..cfdbb74d60971fe725863077e4283723ed62fead 100644 (file)
@@ -4432,12 +4432,14 @@ std::vector<Option> get_global_options() {
     // RocksDB sharding in BlueStore dramatically lifted the number of
     // threads spawn during RocksDB's init.
     .set_validator([](std::string *value, std::string *error_message){
-      if (*value != "false") {
+      if (const bool parsed_value = strict_strtob(value->c_str(), error_message);
+         error_message->empty() && parsed_value) {
         *error_message = "invalid BlueStore sharding configuration."
                          " Be aware any change takes effect only on mkfs!";
         return -EINVAL;
+      } else {
+        return 0;
       }
-      return 0;
     })
 #endif
     .set_description("Enable use of rocksdb column families for bluestore metadata"),