Skip to content

Commit

Permalink
mds: clear CDir::STATE_REJOINUNDEF after fetching dirfrag
Browse files Browse the repository at this point in the history
Fixes: #11541
Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit ab1e539)
  • Loading branch information
ukernel authored and theanalyst committed Jun 7, 2015
1 parent d967cec commit d723e11
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/mds/CDir.cc
Expand Up @@ -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;
Expand Down

0 comments on commit d723e11

Please sign in to comment.