Skip to content

Commit

Permalink
mds/StrayManager: aviod reusing deleted inode in StrayManager::_purge…
Browse files Browse the repository at this point in the history
…_stray_logged

Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
(cherry picked from commit 4978e57)
  • Loading branch information
Zhi Zhang authored and smithfarm committed Apr 14, 2017
1 parent eb84959 commit 64616bb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mds/StrayManager.cc
Expand Up @@ -300,11 +300,6 @@ void StrayManager::_purge_stray_logged(CDentry *dn, version_t pdv, LogSegment *l
dn->state_clear(CDentry::STATE_PURGING | CDentry::STATE_PURGINGPINNED);
dn->put(CDentry::PIN_PURGING);

// drop inode
if (in->is_dirty())
in->mark_clean();
in->mdcache->remove_inode(in);

// drop dentry?
if (dn->is_new()) {
dout(20) << " dn is new, removing" << dendl;
Expand All @@ -313,6 +308,11 @@ void StrayManager::_purge_stray_logged(CDentry *dn, version_t pdv, LogSegment *l
} else {
in->mdcache->touch_dentry_bottom(dn); // drop dn as quickly as possible.
}

// drop inode
if (in->is_dirty())
in->mark_clean();
in->mdcache->remove_inode(in);
}

void StrayManager::enqueue(CDentry *dn, bool trunc)
Expand Down

0 comments on commit 64616bb

Please sign in to comment.