]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: resolve cleanup
authorSage Weil <sage@newdream.net>
Fri, 19 Nov 2010 21:58:31 +0000 (13:58 -0800)
committerSage Weil <sage@newdream.net>
Mon, 22 Nov 2010 17:55:01 +0000 (09:55 -0800)
Only track ambiguous imports and such if we get a resolve message while in
the resolve state.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/MDCache.cc

index 8a0597f7ed0c85d32d16a6347f7d34e619deed30..f944c8724307860741d425a36d35c06badcbf95f 100644 (file)
@@ -2503,19 +2503,20 @@ void MDCache::handle_resolve(MMDSResolve *m)
 
   show_subtrees();
 
-
-  // note ambiguous imports too
-  for (map<dirfrag_t, vector<dirfrag_t> >::iterator pi = m->ambiguous_imports.begin();
-       pi != m->ambiguous_imports.end();
-       ++pi) {
-    dout(10) << "noting ambiguous import on " << pi->first << " bounds " << pi->second << dendl;
-    other_ambiguous_imports[from][pi->first].swap( pi->second );
-  }
-  
-  // did i get them all?
-  got_resolve.insert(from);
+  if (mds->is_resolve()) {
+    // note ambiguous imports too
+    for (map<dirfrag_t, vector<dirfrag_t> >::iterator pi = m->ambiguous_imports.begin();
+        pi != m->ambiguous_imports.end();
+        ++pi) {
+      dout(10) << "noting ambiguous import on " << pi->first << " bounds " << pi->second << dendl;
+      other_ambiguous_imports[from][pi->first].swap( pi->second );
+    }
+    
+    // did i get them all?
+    got_resolve.insert(from);
   
-  maybe_resolve_finish();
+    maybe_resolve_finish();
+  }
 
   m->put();
 }