Skip to contentSkip to conversation

mds: initialize some member variables of MDCache

PATCH New Yan, Zheng 1 participant 2 messages Jun 4, 2013

lore
Share & tools
lore

Yan, Zheng

author
#0 lore raw

PATCH 1/2 mds: initialize some member variables of MDCache

From: "Yan, Zheng" <[email protected]>

I added some member variables to class MDCache, but forget to initialize them.

Fixes #5236
---
 src/mds/MDCache.cc | 5 +++++
 1 file changed, 5 insertions(+)
src/mds/MDCache.cc +5 -0
index 8c17172..e2ecba8 100644
@@ -147,6 +147,7 @@ MDCache::MDCache(MDS *m)
                         (0.9 *(g_conf->osd_max_write_size << 20));
 
   discover_last_tid = 0;
+  open_ino_last_tid = 0;
   find_ino_peer_last_tid = 0;
 
   last_cap_id = 0;
@@ -155,6 +156,10 @@ MDCache::MDCache(MDS *m)
   client_lease_durations[1] = 30.0;
   client_lease_durations[2] = 300.0;
 
+  resolves_pending = false;
+  rejoins_pending = false;
+  cap_imports_num_opening = 0;
+
   opening_root = open = false;
   lru.lru_set_max(g_conf->mds_cache_size);
   lru.lru_set_midpoint(g_conf->mds_cache_mid);
Signature · 1 line
1.8.1.4
author
#1 lore raw

PATCH 2/2 mds: allow purging "dirty parent" stray inode

From: "Yan, Zheng" <[email protected]>

---
 src/mds/MDCache.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
src/mds/MDCache.cc +4 -1
index e2ecba8..7b4f2fa 100644
@@ -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?
Signature · 1 line
1.8.1.4