From: John Spray Date: Fri, 1 May 2015 11:42:16 +0000 (+0100) Subject: mds: handle missing mydir dirfrag X-Git-Tag: v9.0.2~217^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=96992466eea7deee687761300be3c9ecd689ff72;p=ceph.git mds: handle missing mydir dirfrag Previously, if the mydir dirfrag was missing, then creating stray dirs would assert out when trying to project_fnode(). Signed-off-by: John Spray --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 52baafe9ddd..43825b55623 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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;