diff options
author | Joe Buck <jbbuck@gmail.com> | 2013-02-09 18:48:57 -0800 |
---|---|---|
committer | Joe Buck <jbbuck@gmail.com> | 2013-02-11 09:57:36 -0800 |
commit | 133295ed001a950e3296f4e88a916ab2405be0cc (patch) | |
tree | 82f563a7c510747d5d2247e1a4766669dd76a4bf /src/libcephfs.cc | |
parent | a39a48c1b18af21ad8b957f8e627ce70cbec4415 (diff) | |
download | ceph-133295ed001a950e3296f4e88a916ab2405be0cc.tar.gz |
libcephfs: fix for #4068
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>
Diffstat (limited to 'src/libcephfs.cc')
-rw-r--r-- | src/libcephfs.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libcephfs.cc b/src/libcephfs.cc index 6f3c04a6d0a..8ad01f1abfd 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -37,6 +37,7 @@ public: ceph_mount_info(uint64_t msgr_nonce_, CephContext *cct_) : msgr_nonce(msgr_nonce_), mounted(false), + inited(false), client(NULL), monclient(NULL), messenger(NULL), @@ -95,6 +96,8 @@ public: if (ret) goto fail; + inited = true; + ret = client->mount(mount_root); if (ret) goto fail; @@ -121,7 +124,7 @@ public: client->unmount(); mounted = false; } - if (client) { + if (inited) { client->shutdown(); } if (messenger) { @@ -201,6 +204,7 @@ public: private: uint64_t msgr_nonce; bool mounted; + bool inited; Client *client; MonClient *monclient; Messenger *messenger; |