]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: dump range blocklist when dumping regular blocklist
authorGreg Farnum <gfarnum@redhat.com>
Tue, 16 Nov 2021 18:41:08 +0000 (18:41 +0000)
committerGreg Farnum <gfarnum@redhat.com>
Tue, 31 May 2022 23:18:16 +0000 (23:18 +0000)
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
(cherry picked from commit dc09905f1e95201ba8257b70c60c9985eee6ffdb)

src/mon/OSDMonitor.cc

index 7a38a3ae0c895ce6c18b82d557893e4f4f9f593b..0d63ba8b5f6100c9263514e9b71aed440d33405a 100644 (file)
@@ -6042,7 +6042,31 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
       f->close_section();
       f->flush(rdata);
     }
-    ss << "listed " << osdmap.blocklist.size() << " entries";
+    if (f)
+      f->open_array_section("range_blocklist");
+
+    for (auto p = osdmap.range_blocklist.begin();
+        p != osdmap.range_blocklist.end();
+        ++p) {
+      if (f) {
+       f->open_object_section("entry");
+       f->dump_string("range", p->first.get_legacy_str());
+       f->dump_stream("until") << p->second;
+       f->close_section();
+      } else {
+       stringstream ss;
+       string s;
+       ss << p->first << " " << p->second;
+       getline(ss, s);
+       s += "\n";
+       rdata.append(s);
+      }
+    }
+    if (f) {
+      f->close_section();
+      f->flush(rdata);
+    }
+    ss << "listed " << osdmap.blocklist.size() + osdmap.range_blocklist.size() << " entries";
 
   } else if (prefix == "osd pool ls") {
     string detail;