summaryrefslogtreecommitdiff
path: root/src/client/Client.cc
diff options
context:
space:
mode:
authorSam Lang <sam.lang@inktank.com>2012-09-24 09:55:25 -0700
committerSage Weil <sage@inktank.com>2012-12-11 10:08:45 -0800
commitdfd310368267df848f2b65cc536b4ffcb039d353 (patch)
tree0371b8641554e188c4660b07b00afce84538c265 /src/client/Client.cc
parentacebcce91448421c34a72850a380fcd1aabe9f41 (diff)
downloadceph-dfd310368267df848f2b65cc536b4ffcb039d353.tar.gz
client: Fix for #3184 cfuse segv with no keyring
Fixes bug #3184 where the ceph-fuse client segfaults if authx is enabled but no keyring file is present. This was due to the client->init() return value not getting checked. Signed-off-by: Sam Lang <sam.lang@inktank.com> (cherry picked from commit 47983df4cbd31f299eef896b4612d3837bd7c7bd)
Diffstat (limited to 'src/client/Client.cc')
-rw-r--r--src/client/Client.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/client/Client.cc b/src/client/Client.cc
index baa5dfadde5..3af00f52134 100644
--- a/src/client/Client.cc
+++ b/src/client/Client.cc
@@ -272,7 +272,7 @@ void Client::dump_cache()
int Client::init()
{
- Mutex::Locker lock(client_lock);
+ client_lock.Lock();
assert(!initialized);
timer.init();
@@ -283,8 +283,15 @@ int Client::init()
messenger->add_dispatcher_head(this);
int r = monclient->init();
- if (r < 0)
+ if (r < 0) {
+ // need to do cleanup because we're in an intermediate init state
+ timer.shutdown();
+ client_lock.Unlock();
+ objectcacher->stop();
+ monclient->shutdown();
+ messenger->shutdown();
return r;
+ }
objecter->init();
@@ -303,6 +310,7 @@ int Client::init()
cct->get_perfcounters_collection()->add(logger);
initialized = true;
+ client_lock.Unlock();
return r;
}