]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: rectify the guard in RadosClient::wait_for_osdmap(). 3828/head
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Thu, 29 Jan 2015 17:19:16 +0000 (18:19 +0100)
committerLoic Dachary <ldachary@redhat.com>
Fri, 27 Feb 2015 18:23:39 +0000 (19:23 +0100)
RadosClient::wait_for_osdmap() did not signalize lack of connection
via -ENOTCONN error code when the Objecter instance was allocated.
The proper way is to check the connection state explicitly.

Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
(cherry picked from commit 34473f78f101d87d2606e0e7112682a47ff24830)

Conflicts:
src/librados/RadosClient.cc
        the modified guard was not present: add the new guard instead
        of modifying it

src/librados/RadosClient.cc

index 09bc507420ec0a783dd84e8d9787e7260ca21075..a5e77a551a7655023b2e888d9f822daab70fdbb9 100644 (file)
@@ -445,6 +445,10 @@ int librados::RadosClient::wait_for_osdmap()
 {
   assert(lock.is_locked());
 
+  if (state != CONNECTED) {
+    return -ENOTCONN;
+  }
+
   utime_t timeout;
   if (cct->_conf->rados_mon_op_timeout > 0)
     timeout.set_from_double(cct->_conf->rados_mon_op_timeout);