From: Sage Weil Date: Mon, 20 Oct 2008 22:07:08 +0000 (-0700) Subject: mds: kill off inodes that get recovered but no longer have any parents X-Git-Tag: v0.5~246 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=136470cf7ca876febf68a2b0610fa3bb77ad3532;p=ceph.git mds: kill off inodes that get recovered but no longer have any parents --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 73f29dd3e4a1..ef53596ca508 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -3993,11 +3993,18 @@ void MDCache::_recovered(CInode *in, int r) file_recovering.erase(in); in->state_clear(CInode::STATE_RECOVERING); - // make sure this is in "newest" inode struct, and gets journaled - in->get_projected_inode()->size = in->inode.size; - mds->locker->check_inode_max_size(in, true, in->inode.size); - - in->auth_unpin(this); + if (!in->parent && !in->projected_parent) { + dout(10) << " inode has no parents, killing it off" << dendl; + in->auth_unpin(this); + assert(in->get_num_ref() == 0); // right? + remove_inode(in); + } else { + // make sure this is in "newest" inode struct, and gets journaled + in->get_projected_inode()->size = in->inode.size; + mds->locker->check_inode_max_size(in, true, in->inode.size); + + in->auth_unpin(this); + } do_file_recover(); }