]> 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, 3 Mar 2023 06:14:55 +0000 (11: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>
src/mds/ScrubStack.cc

index 5ee97c4ac1a8f1554e1ef0e6609658f3fe806fed..181515c6d6bdc7fbb9dece79e60a50813e5e8ba6 100644 (file)
@@ -655,6 +655,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
 
@@ -683,6 +688,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