]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
monclient: return authetnication error
authorSage Weil <sage@newdream.net>
Thu, 4 Feb 2010 22:35:21 +0000 (14:35 -0800)
committerSage Weil <sage@newdream.net>
Thu, 4 Feb 2010 22:35:21 +0000 (14:35 -0800)
src/librados.cc
src/mon/MonClient.cc
src/mon/MonClient.h

index e40b76b97369e1e39f49547511c755aa3fa3a575..d3a76d12f747f62861f8fce5216c929db6ac5ed9 100644 (file)
@@ -318,7 +318,11 @@ bool RadosClient::init()
   dout(1) << "iit" << dendl;
   monclient.init();
 
-  monclient.authenticate(g_conf.client_mount_timeout);
+  int err = monclient.authenticate(g_conf.client_mount_timeout);
+  if (err) {
+    dout(0) << *g_conf.entity_name << " authentication error " << strerror(-err) << dendl;
+    return false;
+  }
   messenger->set_myname(entity_name_t::CLIENT(monclient.get_global_id()));
 
   lock.Lock();
index 63995d354f8d05914f451d89aa47c2cd909f25dd..bdbaf21e2461b19f08eeab14bbc10759d013c6db 100644 (file)
@@ -273,7 +273,7 @@ int MonClient::authenticate(double timeout)
     _reopen_session();
 
   while (state != MC_STATE_HAVE_SESSION && !authenticate_err)
-    authenticate_cond.Wait(monc_lock);
+    auth_cond.Wait(monc_lock);
 
   if (state == MC_STATE_HAVE_SESSION) {
     dout(5) << "authenticate success, global_id " << global_id << dendl;
@@ -329,7 +329,6 @@ void MonClient::handle_auth(MAuthReply *m)
        _send_mon_message(waiting_for_session.front());
        waiting_for_session.pop_front();
       }
-      authenticate_cond.SignalAll();
     }
   
     _check_auth_rotating();
@@ -491,7 +490,7 @@ int MonClient::wait_authenticate(double timeout)
   if (cur_mon < 0)
     _reopen_session();
 
-  int ret = authenticate_cond.WaitInterval(monc_lock, interval);
+  int ret = auth_cond.WaitInterval(monc_lock, interval);
   dout(0) << "wait_authenticate ended, returned " << ret << dendl;
   return ret;
 }
index e10489f5ef18d1c5a04e9c7d03b7147549b32465..c134d2b599a3a05d6c291450e3e98b172ea4c0f0 100644 (file)
@@ -94,7 +94,6 @@ private:
   // authenticate
 private:
   Cond map_cond;
-  Cond authenticate_cond;
   int authenticate_err;
 
   list<Message*> waiting_for_session;