]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: make blacklist detection handle TYPE_ANY entries
authorSage Weil <sage@redhat.com>
Wed, 2 Jan 2019 17:55:19 +0000 (11:55 -0600)
committerSage Weil <sage@redhat.com>
Thu, 3 Jan 2019 17:17:38 +0000 (11:17 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/client/Client.cc

index 4ee14b7f1d7c35219cc4f0eeaa695a36b1e102a9..e6132327443607e98af67782b3679da183151fe6 100644 (file)
@@ -2487,12 +2487,26 @@ void Client::handle_osd_map(MOSDMap *m)
 
   const auto myaddrs = messenger->get_myaddrs();
   bool new_blacklist = false;
+  bool prenautilus = objecter->with_osdmap(
+    [&](const OSDMap& o) {
+      return o.require_osd_release < CEPH_RELEASE_NAUTILUS;
+    });
   if (!blacklisted) {
-    for (auto& a : myaddrs.v) {
+    for (auto a : myaddrs.v) {
+      // blacklist entries are always TYPE_ANY for nautilus+
+      a.set_type(entity_addr_t::TYPE_ANY);
       if (new_blacklists.count(a)) {
        new_blacklist = true;
        break;
       }
+      if (prenautilus) {
+       // ...except pre-nautilus, they were TYPE_LEGACY
+       a.set_type(entity_addr_t::TYPE_LEGACY);
+       if (new_blacklists.count(a)) {
+         new_blacklist = true;
+         break;
+       }
+      }
     }
   }
   if (new_blacklist) {