diff mbox

[2/2] mds: allow purging "dirty parent" stray inode

Message ID 1370315966-10363-2-git-send-email-zheng.z.yan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yan, Zheng June 4, 2013, 3:19 a.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 src/mds/MDCache.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc
index e2ecba8..7b4f2fa 100644
--- a/src/mds/MDCache.cc
+++ b/src/mds/MDCache.cc
@@ -9156,7 +9156,7 @@  void MDCache::eval_stray(CDentry *dn)
       dout(20) << " pending recovery" << dendl;
       return;  // don't mess with file size probing
     }
-    if (in->get_num_ref() > (int)in->is_dirty()) {
+    if (in->get_num_ref() > (int)in->is_dirty() + (int)in->is_dirty_parent()) {
       dout(20) << " too many inode refs" << dendl;
       return;
     }
@@ -9449,6 +9449,9 @@  void MDCache::_purge_stray_logged(CDentry *dn, version_t pdv, LogSegment *ls)
   // drop inode
   if (in->is_dirty())
     in->mark_clean();
+  if (in->is_dirty_parent())
+    in->clear_dirty_parent();
+
   remove_inode(in);
 
   // drop dentry?