]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: set STATE_AUTH in MDSCacheObject::deocde_import
authorYan, Zheng <zyan@redhat.com>
Mon, 6 Feb 2017 02:53:12 +0000 (10:53 +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/CDir.cc
src/mds/CInode.cc
src/mds/Migrator.cc

index 1faa02e4e937018f9d313f11140ed41dba36c96f..11d5d956e1998135061850970252f0ba33bba1e9 100644 (file)
@@ -2363,7 +2363,8 @@ void CDir::decode_import(bufferlist::iterator& blp, utime_t now, LogSegment *ls)
   unsigned s;
   ::decode(s, blp);
   state &= MASK_STATE_IMPORT_KEPT;
-  state |= (s & MASK_STATE_EXPORTED);
+  state_set(STATE_AUTH | (s & MASK_STATE_EXPORTED));
+
   if (is_dirty()) {
     get(PIN_DIRTY);
     _mark_dirty(ls);
index 1eebf16456ad734d945878c5bec9d1cf9eb9e80d..0f382d959c0015379c676641ac02089b06309e13 100644 (file)
@@ -3595,7 +3595,8 @@ void CInode::decode_import(bufferlist::iterator& p,
 
   unsigned s;
   ::decode(s, p);
-  state |= (s & MASK_STATE_EXPORTED);
+  state_set(STATE_AUTH | (s & MASK_STATE_EXPORTED));
+
   if (is_dirty()) {
     get(PIN_DIRTY);
     _mark_dirty(ls);
index 95e1c89c02218009f79a49f85b47cc5df2e7ed65..43537fd80871bf3b367ad216818e2535ec6f6b7d 100644 (file)
@@ -2764,8 +2764,6 @@ void Migrator::decode_import_inode(CDentry *dn, bufferlist::iterator& blp,
   if (!in) {
     in = new CInode(mds->mdcache, true, 1, last);
     added = true;
-  } else {
-    in->state_set(CInode::STATE_AUTH);
   }
 
   // state after link  -- or not!  -sage
@@ -2885,10 +2883,6 @@ int Migrator::decode_import_dir(bufferlist::iterator& blp,
   // assimilate state
   dir->decode_import(blp, now, ls);
 
-  // mark  (may already be marked from get_or_open_dir() above)
-  if (!dir->is_auth())
-    dir->state_set(CDir::STATE_AUTH);
-
   // adjust replica list
   //assert(!dir->is_replica(oldauth));    // not true on failed export
   dir->add_replica(oldauth, CDir::EXPORT_NONCE);