]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: call objecter->handle_osd_map() under lock
authorYehuda Sadeh <yehuda@inktank.com>
Fri, 28 Mar 2014 00:46:08 +0000 (17:46 -0700)
committerJohn Spray <john.spray@redhat.com>
Mon, 25 Aug 2014 00:33:47 +0000 (01:33 +0100)
The lock is not shared with the objecter anymore so we need to call
it under this lock, otherwise we're going to race with
wait_for_osdmap().

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/librados/RadosClient.cc

index 10f2679b3be1e7ea047852800ff5204e0b9c1f7d..6c0c2b8406d19c658f1cb0c01299232086abfdb5 100644 (file)
@@ -384,8 +384,8 @@ bool librados::RadosClient::_dispatch(Message *m)
     objecter->handle_osd_op_reply(static_cast<MOSDOpReply*>(m));
     break;
   case CEPH_MSG_OSD_MAP:
-    objecter->handle_osd_map(static_cast<MOSDMap*>(m));
     lock.Lock();
+    objecter->handle_osd_map(static_cast<MOSDMap*>(m));
     pool_cache_rwl.get_write();
     osdmap_epoch = osdmap.get_epoch();
     pool_cache_rwl.unlock();