From: Sage Weil Date: Thu, 29 May 2008 22:06:51 +0000 (-0700) Subject: mds: fix resolve bug X-Git-Tag: v0.3~170^2~26 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6a18bf41756d28fdc86180cc1a22df0bbd0ab66f;p=ceph.git mds: fix resolve bug --- diff --git a/src/client/SyntheticClient.cc b/src/client/SyntheticClient.cc index 877eee795b19..7ad5afcc593b 100644 --- a/src/client/SyntheticClient.cc +++ b/src/client/SyntheticClient.cc @@ -1424,6 +1424,9 @@ int SyntheticClient::full_walk(string& basedir) memset(&empty, 0, sizeof(empty)); statq.push_back(empty); + hash_map nlink; + hash_map nlink_seen; + while (!dirq.empty()) { string dir = dirq.front(); frag_info_t expect = statq.front(); @@ -1456,6 +1459,9 @@ int SyntheticClient::full_walk(string& basedir) continue; } + nlink_seen[st.st_ino]++; + nlink[st.st_ino] = st.st_nlink; + if (S_ISDIR(st.st_mode)) actual.nsubdirs++; else @@ -1497,6 +1503,11 @@ int SyntheticClient::full_walk(string& basedir) } } + for (hash_map::iterator p = nlink.begin(); p != nlink.end(); p++) { + if (nlink_seen[p->first] != p->second) + dout(0) << p->first << " nlink " << p->second << " != " << nlink_seen[p->first] << "seen" << dendl; + } + return 0; } diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index c8daddb4302b..f6f8160971f1 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -1079,13 +1079,15 @@ void MDCache::send_resolve_now(int who) } } // [resolving] - if (uncommitted_slave_updates.count(who)) { + if (uncommitted_slave_updates.count(who) && + !uncommitted_slave_updates[who].empty()) { for (map::iterator p = uncommitted_slave_updates[who].begin(); p != uncommitted_slave_updates[who].end(); ++p) { dout(10) << " including uncommitted " << p->first << dendl; m->add_slave_request(p->first); } + dout(10) << " will need resolve ack from mds" << who << dendl; need_resolve_ack.insert(who); } @@ -1246,7 +1248,6 @@ void MDCache::handle_resolve(MMDSResolve *m) // ambiguous slave requests? if (!m->slave_requests.empty()) { MMDSResolveAck *ack = new MMDSResolveAck; - for (list::iterator p = m->slave_requests.begin(); p != m->slave_requests.end(); ++p) { @@ -1260,7 +1261,6 @@ void MDCache::handle_resolve(MMDSResolve *m) ack->add_abort(*p); } } - mds->send_message_mds(ack, from); }