From 6948ed804c389dcb9f2bdb92621edac4dae67352 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Wed, 22 Jun 2016 15:20:52 -0400 Subject: [PATCH] mds: add missing mds_lock locks These commands traverse the mdcache and/or subtrees and so must have the mds_lock. Signed-off-by: Patrick Donnelly --- src/mds/MDSRank.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index 13632ebefb79b..288b69f5af8d3 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -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 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)) { -- 2.39.5