]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: clear PIN_SUBTREE on split/merge in purge_strays
authorSage Weil <sage@newdream.net>
Wed, 17 Nov 2010 19:23:15 +0000 (11:23 -0800)
committerSage Weil <sage@newdream.net>
Wed, 17 Nov 2010 21:06:03 +0000 (13:06 -0800)
This makes the helper work for merge as well as split.  Remove the special
fixups in the caller that were making split work before.

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

index 0778d8e8d395d2f44f8fbcbc96d8583b667fd553..ce1e925812cb97256ceabc4ee761142a314c434b 100644 (file)
@@ -651,6 +651,7 @@ void CDir::purge_stolen(list<Context*>& waiters, bool replay)
   num_head_items = num_head_null = 0;
   num_snap_items = num_snap_null = 0;
 
+  // this mirrors init_fragment_pins()
   if (is_auth()) 
     clear_replica_map();
   if (is_dirty())
@@ -659,11 +660,13 @@ void CDir::purge_stolen(list<Context*>& waiters, bool replay)
     put(PIN_IMPORTBOUND);
   if (state_test(STATE_EXPORTBOUND))
     put(PIN_EXPORTBOUND);
+  if (is_subtree_root())
+    put(PIN_SUBTREE);
 
   if (auth_pins > 0)
     put(PIN_AUTHPIN);
 
-  assert(get_num_ref() == (state_test(STATE_STICKY) ? 1:0) + (is_subtree_root() ? 1:0));
+  assert(get_num_ref() == (state_test(STATE_STICKY) ? 1:0));
 }
 
 void CDir::init_fragment_pins()
index db8888c0040975b13f560702acde876db3b7fea9..c070fab1817d2a476eb18dacacbecbb7113a519c 100644 (file)
@@ -8590,7 +8590,7 @@ void MDCache::adjust_dir_fragments(CInode *diri,
 
       show_subtrees(10);
 
-      dir->put(CDir::PIN_SUBTREE);
+      // dir has no PIN_SUBTREE; CDir::purge_stolen() drops it.
       dir->dir_auth = CDIR_AUTH_DEFAULT;
     }