From 7f6a2561461da104a3700d2881510e8e8755b9d6 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 17 Nov 2010 11:23:15 -0800 Subject: [PATCH] mds: clear PIN_SUBTREE on split/merge in purge_strays 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 --- src/mds/CDir.cc | 5 ++++- src/mds/MDCache.cc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 0778d8e8d395d..ce1e925812cb9 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -651,6 +651,7 @@ void CDir::purge_stolen(list& 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& 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() diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index db8888c004097..c070fab1817d2 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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; } -- 2.39.5