From: dparmar18 Date: Fri, 27 Jan 2023 07:37:47 +0000 (+0530) Subject: mds: make `scrub status` print flag `scrub_mdsdir` X-Git-Tag: v19.0.0~1485^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b32c572192fea394d1f56fb0e3d0f6cf672d5ec3;p=ceph.git mds: make `scrub status` print flag `scrub_mdsdir` and make sure it does not dispose JSON for recursive scrub on ~mdsdir while scrubbing with flag 'scrub_mdsdir' Signed-off-by: Dhairya Parmar --- diff --git a/src/mds/ScrubStack.cc b/src/mds/ScrubStack.cc index 5ee97c4ac1a..181515c6d6b 100644 --- a/src/mds/ScrubStack.cc +++ b/src/mds/ScrubStack.cc @@ -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