]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix resolve bug
authorSage Weil <sage@newdream.net>
Thu, 29 May 2008 22:06:51 +0000 (15:06 -0700)
committerSage Weil <sage@newdream.net>
Thu, 29 May 2008 22:06:51 +0000 (15:06 -0700)
src/client/SyntheticClient.cc
src/mds/MDCache.cc

index 877eee795b19389455e0aefe20c348f584bf42ba..7ad5afcc593b4e9a5d38522e28efd99292a8ed61 100644 (file)
@@ -1424,6 +1424,9 @@ int SyntheticClient::full_walk(string& basedir)
   memset(&empty, 0, sizeof(empty));
   statq.push_back(empty);
 
+  hash_map<inodeno_t, int> nlink;
+  hash_map<inodeno_t, int> 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<inodeno_t,int>::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;
 }
 
index c8daddb4302bf8c2a1ea381f369f73365c45742d..f6f8160971f1845cccf1c9965be5ab7f34110e44 100644 (file)
@@ -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<metareqid_t, MDSlaveUpdate*>::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<metareqid_t>::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);
   }