]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: find approximal bounds when adjusting subtree auth 1520/head
authorYan, Zheng <zheng.z.yan@intel.com>
Sat, 29 Mar 2014 02:36:12 +0000 (10:36 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Sat, 29 Mar 2014 13:41:28 +0000 (21:41 +0800)
When finishing exporting a subtree, the exporter MDS drops locks and
sends MExportDirFinish message to the importer MDS. The bounds of
subtree can get fragmented by third party before the importer MDS
receives the MExportDirFinish message. So the importer MDS can add
inaccurate bounds to the EImportFinish event.

The fix is find approximal bounds when finishing ambiguous imports.

src/mds/MDCache.cc

index 9e9a835ee5974a2da32108ae9e663b1fe89e59bd..c457750647d5c6aea7b7abe69086fdb7a82cd42b 100644 (file)
@@ -1084,24 +1084,13 @@ void MDCache::get_force_dirfrag_bound_set(vector<dirfrag_t>& dfs, set<CDir*>& bo
   }
 }
 
-
 void MDCache::adjust_bounded_subtree_auth(CDir *dir, vector<dirfrag_t>& bound_dfs, pair<int,int> auth)
 {
   dout(7) << "adjust_bounded_subtree_auth " << dir->get_dir_auth() << " -> " << auth
-         << " on " << *dir 
-         << " bound_dfs " << bound_dfs
-         << dendl;
-  
-  // make bounds list
+         << " on " << *dir << " bound_dfs " << bound_dfs << dendl;
+
   set<CDir*> bounds;
-  for (vector<dirfrag_t>::iterator p = bound_dfs.begin();
-       p != bound_dfs.end();
-       ++p) {
-    CDir *bd = get_dirfrag(*p);
-    if (bd) 
-      bounds.insert(bd);
-  }
-  
+  get_force_dirfrag_bound_set(bound_dfs, bounds);
   adjust_bounded_subtree_auth(dir, bounds, auth);
 }
 
@@ -2997,11 +2986,7 @@ void MDCache::handle_resolve(MMDSResolve *m)
     CDir *dir = get_force_dirfrag(pi->first);
     if (!dir)
       continue;
-
-    set<CDir*> bounds;
-    get_force_dirfrag_bound_set(pi->second, bounds);
-
-    adjust_bounded_subtree_auth(dir, bounds, from);
+    adjust_bounded_subtree_auth(dir, pi->second, from);
     try_subtree_merge(dir);
   }