]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: clear CDir::STATE_REJOINUNDEF after fetching dirfrag 4652/head
authorYan, Zheng <zyan@redhat.com>
Tue, 12 May 2015 06:52:30 +0000 (14:52 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 12 May 2015 07:26:24 +0000 (15:26 +0800)
Fixes: #11541
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/CDir.cc

index f17740eb79dc92cf651dac65bceef7d3a2f2e300..97e05a637d3ed0cf735939889bf1920283b934b2 100644 (file)
@@ -1413,9 +1413,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;