mirror of
https://github.com/ceph/ceph
synced 2024-12-26 21:43:10 +00:00
mds: make get_dirfrags_under behave when dirfragtree is not coherent with dirfrag set
This is (currently) the case during replay/resolve, although it's not clear that it should be. Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
f66d472845
commit
4c53c72627
@ -439,9 +439,16 @@ frag_t CInode::pick_dirfrag(const string& dn)
|
||||
|
||||
bool CInode::get_dirfrags_under(frag_t fg, list<CDir*>& ls)
|
||||
{
|
||||
bool all = true;
|
||||
for (map<frag_t,CDir*>::iterator p = dirfrags.begin(); p != dirfrags.end(); ++p) {
|
||||
if (fg.contains(p->first))
|
||||
ls.push_back(p->second);
|
||||
else
|
||||
all = false;
|
||||
}
|
||||
/*
|
||||
list<frag_t> fglist;
|
||||
dirfragtree.get_leaves_under(fg, fglist);
|
||||
bool all = true;
|
||||
for (list<frag_t>::iterator p = fglist.begin();
|
||||
p != fglist.end();
|
||||
++p)
|
||||
@ -449,6 +456,7 @@ bool CInode::get_dirfrags_under(frag_t fg, list<CDir*>& ls)
|
||||
ls.push_back(dirfrags[*p]);
|
||||
else
|
||||
all = false;
|
||||
*/
|
||||
return all;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user