From 0593e5c21c077a4dd4f3a82dfddb7ac756fe7dcc Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 31 Dec 2022 02:24:42 +0300 Subject: [PATCH] Fix OSD peer config safety check --- src/osd_cluster.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osd_cluster.cpp b/src/osd_cluster.cpp index f6716ad1..4ff3ac52 100644 --- a/src/osd_cluster.cpp +++ b/src/osd_cluster.cpp @@ -132,7 +132,7 @@ bool osd_t::check_peer_config(osd_client_t *cl, json11::Json conf) this->osd_num, immediate_commit == IMMEDIATE_ALL ? "all" : "small", cl->osd_num, conf["immediate_commit"].string_value().c_str() ); - return true; + return false; } else if (conf["block_size"].uint64_value() != (uint64_t)this->bs_block_size) { @@ -140,7 +140,7 @@ bool osd_t::check_peer_config(osd_client_t *cl, json11::Json conf) "[OSD %lu] My block_size is %u, but peer OSD %lu has %lu. We can't work together\n", this->osd_num, this->bs_block_size, cl->osd_num, conf["block_size"].uint64_value() ); - return true; + return false; } else if (conf["bitmap_granularity"].uint64_value() != (uint64_t)this->bs_bitmap_granularity) { @@ -148,7 +148,7 @@ bool osd_t::check_peer_config(osd_client_t *cl, json11::Json conf) "[OSD %lu] My bitmap_granularity is %u, but peer OSD %lu has %lu. We can't work together\n", this->osd_num, this->bs_bitmap_granularity, cl->osd_num, conf["bitmap_granularity"].uint64_value() ); - return true; + return false; } } return true;