]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: handle missing mydir dirfrag 4520/head
authorJohn Spray <john.spray@redhat.com>
Fri, 1 May 2015 11:42:16 +0000 (12:42 +0100)
committerJohn Spray <john.spray@redhat.com>
Fri, 1 May 2015 12:00:57 +0000 (13:00 +0100)
Previously, if the mydir dirfrag was missing, then
creating stray dirs would assert out when trying
to project_fnode().

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDCache.cc

index 52baafe9dddf601fce61d72ed049a7745721d4ae..43825b55623b5cbcba54ac587d2d7908c1b4d250 100644 (file)
@@ -626,6 +626,14 @@ void MDCache::populate_mydir()
 
   dout(10) << "populate_mydir " << *mydir << dendl;
 
+  if (mydir->get_version() == 0) {
+    // A fresh dirfrag, we must dirty it before dirtying
+    // any of the strays we create within it.
+    LogSegment *ls = mds->mdlog->get_current_segment();
+    mydir->mark_complete();
+    mydir->mark_dirty(mydir->pre_dirty(), ls);
+  }
+
   if (!mydir->is_complete()) {
     mydir->fetch(new C_MDS_RetryOpenRoot(this));
     return;