ceph_assert(r == 0);
r = admin_socket->register_command("scrub start "
"name=path,type=CephString "
- "name=scrubops,type=CephChoices,strings=force|recursive|repair,n=N,req=false "
+ "name=scrubops,type=CephChoices,strings=force|recursive|repair|scrub_mdsdir,n=N,req=false "
"name=tag,type=CephString,req=false",
asok_hook,
"scrub and inode and output results");
bool force = false;
bool recursive = false;
bool repair = false;
+ bool scrub_mdsdir = false;
for (auto &op : scrubop_vec) {
if (op == "force")
force = true;
recursive = true;
else if (op == "repair")
repair = true;
+ else if (op == "scrub_mdsdir" && path == "/")
+ scrub_mdsdir = true;
}
std::lock_guard l(mds_lock);
+ if (scrub_mdsdir) {
+ MDSGatherBuilder gather(g_ceph_context);
+ mdcache->enqueue_scrub("~mdsdir", tag, false, true, false, f, gather.new_sub());
+ gather.set_finisher(new C_MDSInternalNoop);
+ gather.activate();
+ }
mdcache->enqueue_scrub(path, tag, force, recursive, repair, f, on_finish);
// scrub_dentry() finishers will dump the data for us; we're done!
}