From d723e1156e70a492d633e43b86e7c373e5750065 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Tue, 12 May 2015 14:52:30 +0800 Subject: [PATCH] mds: clear CDir::STATE_REJOINUNDEF after fetching dirfrag Fixes: #11541 Signed-off-by: Yan, Zheng (cherry picked from commit ab1e5394dc778f6799472bd79a4d9ba7197107c2) --- src/mds/CDir.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 235b0dd8cb23a..5b72d5176a9c4 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -1402,9 +1402,17 @@ void CDir::fetch(MDSInternalContextBase *c, const string& want_dn, bool ignore_a // unlinked directory inode shouldn't have any entry if (inode->inode.nlink == 0 && !inode->snaprealm) { dout(7) << "fetch dirfrag for unlinked directory, mark complete" << dendl; - if (get_version() == 0) + if (get_version() == 0) { set_version(1); + + if (state_test(STATE_REJOINUNDEF)) { + assert(cache->mds->is_rejoin()); + state_clear(STATE_REJOINUNDEF); + cache->opened_undef_dirfrag(this); + } + } mark_complete(); + if (c) cache->mds->queue_waiter(c); return;