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:
Sage Weil 2011-01-04 14:35:41 -08:00
parent f66d472845
commit 4c53c72627

View File

@ -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;
}