From fdc77db03881d4cf3367dfa8cae93befccb28afd Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 9 Jul 2008 09:44:52 -0700 Subject: [PATCH] mds: fix file purging vs delayed cap release --- src/mds/Locker.cc | 7 +++++++ src/mds/MDCache.cc | 1 + 2 files changed, 8 insertions(+) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index bd354a33f55cc..709bddd79e0eb 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -497,6 +497,13 @@ void Locker::file_update_finish(CInode *in, Mutation *mut, bool share) if (share && in->is_auth() && in->filelock.is_stable()) share_inode_max_size(in); + + // stray? may need to purge (e.g., after all caps are released) + if (in->inode.nlink == 0 && !in->is_any_caps() && + in->is_auth() && + in->get_parent_dn() && + in->get_parent_dn()->get_dir()->get_inode()->is_stray()) + mdcache->eval_stray(in->get_parent_dn()); } Capability* Locker::issue_new_caps(CInode *in, diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 208ffffe8fedf..1abc9548460fb 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -5095,6 +5095,7 @@ void MDCache::_anchor_logged(CInode *in, version_t atid, Mutation *mut) void MDCache::eval_stray(CDentry *dn) { dout(10) << "eval_stray " << *dn << dendl; + dout(10) << " inode is " << *dn->get_inode() << dendl; assert(dn->is_primary()); CInode *in = dn->inode; assert(in); -- 2.47.3