]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add missing mds_lock locks 9877/head
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 22 Jun 2016 19:20:52 +0000 (15:20 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 22 Jun 2016 19:26:43 +0000 (15:26 -0400)
These commands traverse the mdcache and/or subtrees and so must have the
mds_lock.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/MDSRank.cc

index 13632ebefb79bdb47e0b2e405f711b8a5bc443d0..288b69f5af8d3ab19c58ace4f90d4a0f7ef2b1ee 100644 (file)
@@ -1750,6 +1750,7 @@ bool MDSRankDispatcher::handle_asok_command(
     }
     command_export_dir(f, path, (mds_rank_t)rank);
   } else if (command == "dump cache") {
+    Mutex::Locker l(mds_lock);
     string path;
     if(!cmd_getval(g_ceph_context, cmdmap, "path", path)) {
       mdcache->dump_cache(f);
@@ -2042,6 +2043,7 @@ int MDSRank::_command_flush_journal(std::stringstream *ss)
 void MDSRank::command_get_subtrees(Formatter *f)
 {
   assert(f != NULL);
+  Mutex::Locker l(mds_lock);
 
   std::list<CDir*> subtrees;
   mdcache->list_subtrees(subtrees);
@@ -2079,6 +2081,7 @@ int MDSRank::_command_export_dir(
     const std::string &path,
     mds_rank_t target)
 {
+  Mutex::Locker l(mds_lock);
   filepath fp(path.c_str());
 
   if (target == whoami || !mdsmap->is_up(target) || !mdsmap->is_in(target)) {