]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: mark new root inode dirty 21762/head
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 1 May 2018 22:25:04 +0000 (15:25 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 2 May 2018 03:20:13 +0000 (20:20 -0700)
Fixes: http://tracker.ceph.com/issues/23960
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/CInode.cc
src/mds/CInode.h
src/mds/MDCache.cc
src/mds/Server.cc
src/mds/journal.cc

index ac4af11bd38e09cc4674de77fed0f406e50b7c4a..dd4888c038d2b45fa212d1a217e2ddc5f23ac6c1 100644 (file)
@@ -400,7 +400,7 @@ void CInode::pop_and_dirty_projected_inode(LogSegment *ls)
   inode = front.inode;
 
   if (inode.is_backtrace_updated())
-    _mark_dirty_parent(ls, old_pool != inode.layout.pool_id);
+    mark_dirty_parent(ls, old_pool != inode.layout.pool_id);
 
   if (front.xattrs) {
     --num_projected_xattrs;
@@ -1350,7 +1350,7 @@ void CInode::fetch_backtrace(Context *fin, bufferlist *backtrace)
   mdcache->fetch_backtrace(inode.ino, get_backtrace_pool(), *backtrace, fin);
 }
 
-void CInode::_mark_dirty_parent(LogSegment *ls, bool dirty_pool)
+void CInode::mark_dirty_parent(LogSegment *ls, bool dirty_pool)
 {
   if (!state_test(STATE_DIRTYPARENT)) {
     dout(10) << __func__ << dendl;
@@ -1398,7 +1398,7 @@ void CInode::verify_diri_backtrace(bufferlist &bl, int err)
     mds->clog->error() << "bad backtrace on directory inode " << ino();
     assert(!"bad backtrace" == (g_conf->mds_verify_backtrace > 1));
 
-    _mark_dirty_parent(mds->mdlog->get_current_segment(), false);
+    mark_dirty_parent(mds->mdlog->get_current_segment(), false);
     mds->mdlog->flush();
   }
 }
@@ -3881,7 +3881,7 @@ void CInode::decode_import(bufferlist::iterator& p,
   }
   if (is_dirty_parent()) {
     get(PIN_DIRTYPARENT);
-    _mark_dirty_parent(ls);
+    mark_dirty_parent(ls);
   }
 
   decode(pop, ceph_clock_now(), p);
@@ -4135,7 +4135,7 @@ next:
         in->make_path_string(path);
         in->mdcache->mds->clog->warn() << "bad backtrace on inode " << in->ino()
                                        << "(" << path << "), rewriting it";
-        in->_mark_dirty_parent(in->mdcache->mds->mdlog->get_current_segment(),
+        in->mark_dirty_parent(in->mdcache->mds->mdlog->get_current_segment(),
                            false);
         // Flag that we repaired this BT so that it won't go into damagetable
         results->backtrace.repaired = true;
index dc83aeea793ab2289c29e976a1c63ff1a06f999f..ddf2c4bd46dbb71c7fbee668709533ad36ffd472 100644 (file)
@@ -807,7 +807,7 @@ protected:
    */
   int64_t get_backtrace_pool() const;
 public:
-  void _mark_dirty_parent(LogSegment *ls, bool dirty_pool=false);
+  void mark_dirty_parent(LogSegment *ls, bool dirty_pool=false);
   void clear_dirty_parent();
   void verify_diri_backtrace(bufferlist &bl, int err);
   bool is_dirty_parent() { return state_test(STATE_DIRTYPARENT); }
index eb07de00ed1aa27f044df43045401345c163f148..bdb96c4dd57da56ad0f32c5b0e1181ec897fc869 100644 (file)
@@ -439,7 +439,10 @@ void MDCache::create_empty_hierarchy(MDSGather *gather)
   rootdir->mark_dirty(rootdir->pre_dirty(), mds->mdlog->get_current_segment());
   rootdir->commit(0, gather->new_sub());
 
-  root->store(gather->new_sub());
+  root->mark_clean();
+  root->mark_dirty(root->pre_dirty(), mds->mdlog->get_current_segment());
+  root->mark_dirty_parent(mds->mdlog->get_current_segment(), true);
+  root->flush(gather->new_sub());
 }
 
 void MDCache::create_mydir_hierarchy(MDSGather *gather)
@@ -469,7 +472,7 @@ void MDCache::create_mydir_hierarchy(MDSGather *gather)
     straydir->mark_complete();
     straydir->mark_dirty(straydir->pre_dirty(), ls);
     straydir->commit(0, gather->new_sub());
-    stray->_mark_dirty_parent(ls, true);
+    stray->mark_dirty_parent(ls, true);
     stray->store_backtrace(gather->new_sub());
   }
 
index 347a5c33ff4cf42adc7b0a5c8eed224130bf1be4..a7f2f38c4ca5d808348ec79db82eb1646a347815 100644 (file)
@@ -3530,7 +3530,7 @@ public:
     // dirty inode, dn, dir
     newi->inode.version--;   // a bit hacky, see C_MDS_mknod_finish
     newi->mark_dirty(newi->inode.version+1, mdr->ls);
-    newi->_mark_dirty_parent(mdr->ls, true);
+    newi->mark_dirty_parent(mdr->ls, true);
 
     mdr->apply();
 
@@ -5155,7 +5155,7 @@ public:
     // a new version of hte inode since it's just been created)
     newi->inode.version--; 
     newi->mark_dirty(newi->inode.version + 1, mdr->ls);
-    newi->_mark_dirty_parent(mdr->ls, true);
+    newi->mark_dirty_parent(mdr->ls, true);
 
     // mkdir?
     if (newi->inode.is_dir()) { 
index e0ed5d5e1df5195cd9d353b1348f6c66e82cea03..23c2f15a54b6af5d4ceab27e88fb12dc6a9893f8 100644 (file)
@@ -1317,7 +1317,7 @@ void EMetaBlob::replay(MDSRank *mds, LogSegment *logseg, MDSlaveUpdate *slaveup)
       if (p->is_dirty())
        in->_mark_dirty(logseg);
       if (p->is_dirty_parent())
-       in->_mark_dirty_parent(logseg, p->is_dirty_pool());
+       in->mark_dirty_parent(logseg, p->is_dirty_pool());
       if (p->need_snapflush())
        logseg->open_files.push_back(&in->item_open_file);
       if (dn->is_auth())