]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: make `scrub status` print flag `scrub_mdsdir`
authordparmar18 <dparmar@redhat.com>
Fri, 27 Jan 2023 07:37:47 +0000 (13:07 +0530)
committerDhairya Parmar <dparmar@redhat.com>
Fri, 31 Mar 2023 10:14:13 +0000 (15:44 +0530)
and make sure it does not dispose JSON for recursive scrub
on ~mdsdir while scrubbing with flag 'scrub_mdsdir'

Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
(cherry picked from commit b32c572192fea394d1f56fb0e3d0f6cf672d5ec3)

src/mds/ScrubStack.cc

index c6ac668150ce86163e79c4903caf58f466d02141..8f3d591ed4f57021b2c385941b135251740b872b 100644 (file)
@@ -633,6 +633,11 @@ void ScrubStack::scrub_status(Formatter *f) {
     have_more = false;
     auto& header = p.second;
 
+    if (mdcache->get_inode(header->get_origin())->is_mdsdir() 
+    && header->get_scrub_mdsdir() && header->get_tag().empty()) {
+      continue;
+    }
+
     std::string tag(header->get_tag());
     f->open_object_section(tag.c_str()); // scrub id
 
@@ -661,6 +666,12 @@ void ScrubStack::scrub_status(Formatter *f) {
       }
       *optcss << "force";
     }
+    if (header->get_scrub_mdsdir()) {
+      if (have_more) {
+        *optcss << ",";
+      }
+      *optcss << "scrub_mdsdir";
+    }
 
     f->dump_string("options", optcss->strv());
     f->close_section(); // scrub id