If client->init() fails in mount, then client->shutdown()
should not be called. This patch uses a bool to ensure
that shutdown is only called if init() succeeds.
Signed-off-by: Joe Buck <jbbuck@gmail.com>
Reviewed-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
ceph_mount_info(uint64_t msgr_nonce_, CephContext *cct_)
: msgr_nonce(msgr_nonce_),
mounted(false),
+ inited(false),
client(NULL),
monclient(NULL),
messenger(NULL),
if (ret)
goto fail;
+ inited = true;
+
ret = client->mount(mount_root);
if (ret)
goto fail;
client->unmount();
mounted = false;
}
- if (client) {
+ if (inited) {
client->shutdown();
}
if (messenger) {
private:
uint64_t msgr_nonce;
bool mounted;
+ bool inited;
Client *client;
MonClient *monclient;
Messenger *messenger;