]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: avoid zero replica_nonce
authorYan, Zheng <zyan@redhat.com>
Mon, 6 Feb 2017 03:03:38 +0000 (11:03 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 20 Feb 2017 08:12:36 +0000 (16:12 +0800)
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/CDentry.h
src/mds/CInode.cc
src/mds/Migrator.cc

index d280eece5d5c369df74dad0c0a5ae6d2c96f16d9..aff459421d8497dc6f12e39460dcd403460a9363 100644 (file)
@@ -315,6 +315,7 @@ public:
       _mark_dirty(ls);
     if (!replica_map.empty())
       get(PIN_REPLICATED);
+    replica_nonce = 0;
   }
 
   // -- locking --
index 0f382d959c0015379c676641ac02089b06309e13..ea81ed8c970f6471883be867cf88cd9de2a5882c 100644 (file)
@@ -3611,6 +3611,7 @@ void CInode::decode_import(bufferlist::iterator& p,
   ::decode(replica_map, p);
   if (!replica_map.empty())
     get(PIN_REPLICATED);
+  replica_nonce = 0;
 
   // decode fragstat info on bounding cdirs
   bufferlist bounding;
index 43537fd80871bf3b367ad216818e2535ec6f6b7d..98279d0f2f5a05736d14d6c60c0f0e6da344c603 100644 (file)
@@ -2410,6 +2410,7 @@ void Migrator::import_reverse(CDir *dir)
     cur->state_clear(CDir::STATE_AUTH);
     cur->remove_bloom();
     cur->clear_replica_map();
+    cur->set_replica_nonce(CDir::EXPORT_NONCE);
     if (cur->is_dirty())
       cur->mark_clean();
 
@@ -2420,6 +2421,7 @@ void Migrator::import_reverse(CDir *dir)
       // dentry
       dn->state_clear(CDentry::STATE_AUTH);
       dn->clear_replica_map();
+      dn->set_replica_nonce(CDentry::EXPORT_NONCE);
       if (dn->is_dirty()) 
        dn->mark_clean();
 
@@ -2428,6 +2430,7 @@ void Migrator::import_reverse(CDir *dir)
        CInode *in = dn->get_linkage()->get_inode();
        in->state_clear(CDentry::STATE_AUTH);
        in->clear_replica_map();
+       in->set_replica_nonce(CInode::EXPORT_NONCE);
        if (in->is_dirty()) 
          in->mark_clean();
        in->clear_dirty_rstat();