]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: skip inode that is being puring when opening snap past parent 3951/head
authorYan, Zheng <zyan@redhat.com>
Tue, 17 Mar 2015 12:31:14 +0000 (20:31 +0800)
committerYan, Zheng <zyan@redhat.com>
Wed, 18 Mar 2015 06:25:44 +0000 (14:25 +0800)
we can not increase reference count of purging inodes. purging
inodes have no snapshots, so it's OK to skip them.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/SnapRealm.cc

index 080d44c7b5c3cc1bce80a25ff1381f1e31a032ca..14af91f8f704ea0a4d29a6f0c567ab382b72a7cd 100644 (file)
@@ -115,8 +115,7 @@ bool SnapRealm::_open_parents(MDSInternalContextBase *finish, snapid_t first, sn
   assert(srnode.past_parents.size() >= open_past_parents.size());
   if (srnode.past_parents.size() > open_past_parents.size()) {
     for (map<snapid_t, snaplink_t>::iterator p = srnode.past_parents.begin();
-        p != srnode.past_parents.end();
-        ++p) {    
+        p != srnode.past_parents.end(); ) {
       dout(10) << " past_parent [" << p->second.first << "," << p->first << "] is "
               << p->second.ino << dendl;
       CInode *parent = mdcache->get_inode(p->second.ino);
@@ -126,12 +125,18 @@ bool SnapRealm::_open_parents(MDSInternalContextBase *finish, snapid_t first, sn
        mdcache->open_ino(p->second.ino, mdcache->mds->mdsmap->get_metadata_pool(), fin);
        return false;
       }
+      if (parent->state_test(CInode::STATE_PURGING)) {
+       dout(10) << " skip purging past_parent " << *parent << dendl;
+       srnode.past_parents.erase(p++);
+       continue;
+      }
       assert(parent->snaprealm);  // hmm!
       if (!parent->snaprealm->_open_parents(finish, p->second.first, p->first))
        return false;
       if (!open_past_parents.count(p->second.ino)) {
        add_open_past_parent(parent->snaprealm);
       }
+      ++p;
     }
   }