]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
nvmeofgw*: fix no-listeners 61113/head
authorLeonid Chernin <leonidc@il.ibm.com>
Tue, 17 Dec 2024 10:46:25 +0000 (10:46 +0000)
committerLeonid Chernin <leonidc@il.ibm.com>
Tue, 17 Dec 2024 10:46:25 +0000 (10:46 +0000)
Signed-off-by: Leonid Chernin <leonidc@il.ibm.com>
src/mon/NVMeofGwMon.cc

index 0fe5c3e655f7d2b208db51ebc06eeda23710598c..9d5304cedf5154d9e6bd0e50bfaa7d38be4a5131 100644 (file)
@@ -625,15 +625,15 @@ bool NVMeofGwMon::prepare_beacon(MonOpRequestRef op)
     avail = gw_availability_t::GW_CREATED;
     dout(20) << "No-subsystems condition detected for GW " << gw_id <<dendl;
   } else {
-    bool listener_found = true;
+    bool listener_found = false;
     for (auto &subs: sub) {
-      if (subs.listeners.size() == 0) {
-        listener_found = false;
-        dout(10) << "No-listeners condition detected for GW " << gw_id << " for nqn " << subs.nqn << dendl;
+      if (subs.listeners.size()) {
+        listener_found = true;
         break;
       }
     }
     if (!listener_found) {
+     dout(10) << "No-listeners condition detected for GW " << gw_id << dendl;
      avail = gw_availability_t::GW_CREATED;
     }
   }// for HA no-subsystems and no-listeners are same usecases