mirror of
https://github.com/ceph/ceph
synced 2025-02-23 11:07:35 +00:00
Merge pull request #53670 from mchangir/mds-enqueue-all-child-frags-for-scrub-for-a-given-fragset
mds/scrub: enqueue all child frags for a given fragset Reviewed-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Patrick Donnelly <pdonnell@redhat.com> Reviewed-by: Rishabh Dave <ridave@redhat.com>
This commit is contained in:
commit
e283219800
@ -891,22 +891,30 @@ void ScrubStack::handle_scrub(const cref_t<MMDSScrub> &m)
|
||||
|
||||
std::vector<CDir*> dfs;
|
||||
MDSGatherBuilder gather(g_ceph_context);
|
||||
frag_vec_t frags;
|
||||
diri->dirfragtree.get_leaves(frags);
|
||||
for (const auto& fg : m->get_frags()) {
|
||||
CDir *dir = diri->get_dirfrag(fg);
|
||||
if (!dir) {
|
||||
dout(10) << __func__ << " no frag " << fg << dendl;
|
||||
continue;
|
||||
for (auto f : frags) {
|
||||
if (!fg.contains(f)) {
|
||||
dout(20) << __func__ << " skipping " << f << dendl;
|
||||
continue;
|
||||
}
|
||||
CDir *dir = diri->get_or_open_dirfrag(mdcache, f);
|
||||
if (!dir) {
|
||||
dout(10) << __func__ << " no frag " << f << dendl;
|
||||
continue;
|
||||
}
|
||||
if (!dir->is_auth()) {
|
||||
dout(10) << __func__ << " not auth " << *dir << dendl;
|
||||
continue;
|
||||
}
|
||||
if (!dir->can_auth_pin()) {
|
||||
dout(10) << __func__ << " can't auth pin " << *dir << dendl;
|
||||
dir->add_waiter(CDir::WAIT_UNFREEZE, gather.new_sub());
|
||||
continue;
|
||||
}
|
||||
dfs.push_back(dir);
|
||||
}
|
||||
if (!dir->is_auth()) {
|
||||
dout(10) << __func__ << " not auth " << *dir << dendl;
|
||||
continue;
|
||||
}
|
||||
if (!dir->can_auth_pin()) {
|
||||
dout(10) << __func__ << " can't auth pin " << *dir << dendl;
|
||||
dir->add_waiter(CDir::WAIT_UNFREEZE, gather.new_sub());
|
||||
continue;
|
||||
}
|
||||
dfs.push_back(dir);
|
||||
}
|
||||
|
||||
if (gather.has_subs()) {
|
||||
|
Loading…
Reference in New Issue
Block a user