diff mbox

[10/29] mds: skip frozen inode when assimilating dirty inodes' rstat

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

Commit Message

Yan, Zheng Jan. 4, 2013, 9:02 a.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

CDir::assimilate_dirty_rstat_inodes() may encounter frozen inodes that
are being renamed. Skip these frozen inodes because assimilating inode's
rstat require auth pinning the inode.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 src/mds/CDir.cc | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc
index 20ff469..91636cc 100644
--- a/src/mds/CDir.cc
+++ b/src/mds/CDir.cc
@@ -1022,6 +1022,9 @@  void CDir::assimilate_dirty_rstat_inodes()
   for (elist<CInode*>::iterator p = dirty_rstat_inodes.begin_use_current();
        !p.end(); ++p) {
     CInode *in = *p;
+    if (in->is_frozen())
+      continue;
+
     inode_t *pi = in->project_inode();
     pi->version = in->pre_dirty();
 
@@ -1040,16 +1043,22 @@  void CDir::assimilate_dirty_rstat_inodes_finish(Mutation *mut, EMetaBlob *blob)
   elist<CInode*>::iterator p = dirty_rstat_inodes.begin_use_current();
   while (!p.end()) {
     CInode *in = *p;
-    CDentry *dn = in->get_projected_parent_dn();
     ++p;
 
+    if (in->is_frozen())
+      continue;
+
+    CDentry *dn = in->get_projected_parent_dn();
+
     mut->auth_pin(in);
     mut->add_projected_inode(in);
 
     in->clear_dirty_rstat();
     blob->add_primary_dentry(dn, true, in);
   }
-  assert(dirty_rstat_inodes.empty());
+
+  if (!dirty_rstat_inodes.empty())
+    inode->mdcache->mds->locker->mark_updated_scatterlock(&inode->nestlock);
 }