]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/objecter: fix race condition
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 2 Feb 2016 06:58:59 +0000 (14:58 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 2 Feb 2016 06:58:59 +0000 (14:58 +0800)
Fixes: #14603
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osdc/Objecter.cc

index 9bfbb06550af743bae2bbeaca1e71e20a8a77e5b..8fd5c38a3aeb9ddeb1d2087753ede0b2e294ae53 100644 (file)
@@ -2591,6 +2591,7 @@ void Objecter::update_pool_full_map(map<int64_t, bool>& pool_full_map)
 int64_t Objecter::get_object_hash_position(int64_t pool, const string& key,
                                           const string& ns)
 {
+  RWLock::RLocker rl(rwlock);
   const pg_pool_t *p = osdmap->get_pg_pool(pool);
   if (!p)
     return -ENOENT;
@@ -2600,6 +2601,7 @@ int64_t Objecter::get_object_hash_position(int64_t pool, const string& key,
 int64_t Objecter::get_object_pg_hash_position(int64_t pool, const string& key,
                                              const string& ns)
 {
+  RWLock::RLocker rl(rwlock);
   const pg_pool_t *p = osdmap->get_pg_pool(pool);
   if (!p)
     return -ENOENT;