summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Lang <sam.lang@inktank.com>2013-01-02 16:07:13 -0600
committerSam Lang <sam.lang@inktank.com>2013-01-02 16:38:28 -0600
commitd8940d15c330d05c8a198ff7dde16df748938b65 (patch)
treebb76fd974d86f8497571e67a5257b8fb69726ece
parent9a1cf518883e23d81eee2b30746404eddb6bee87 (diff)
downloadceph-d8940d15c330d05c8a198ff7dde16df748938b65.tar.gz
fuse: Fix cleanup code path on init failure
With the changes from 856f32ab, the cfuse.init call returns a _positive_ errno, which was getting ignored. Also, if an error occurs during cfuse.init(), we need to teardown the client mount. Signed-off-by: Sam Lang <sam.lang@inktank.com>
-rw-r--r--src/ceph_fuse.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ceph_fuse.cc b/src/ceph_fuse.cc
index de513bcf0a8..f7a8d1a2c73 100644
--- a/src/ceph_fuse.cc
+++ b/src/ceph_fuse.cc
@@ -155,14 +155,15 @@ int main(int argc, const char **argv, const char *envp[]) {
}
r = cfuse.init(newargc, newargv);
- if (r < 0) {
+ if (r != 0) {
cerr << "ceph-fuse[" << getpid() << "]: fuse failed to initialize" << std::endl;
- goto out_shutdown;
+ goto out_client_unmount;
}
cerr << "ceph-fuse[" << getpid() << "]: starting fuse" << std::endl;
r = cfuse.loop();
cerr << "ceph-fuse[" << getpid() << "]: fuse finished with error " << r << std::endl;
+ out_client_unmount:
client->unmount();
//cout << "unmounted" << std::endl;