1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

vfs_ceph: cleanup mount handle on failure

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
This commit is contained in:
David Disseldorp 2017-02-08 17:11:30 +01:00
parent 129015d1a6
commit 667fb18f1e

View File

@ -111,19 +111,21 @@ static int cephwrap_connect(struct vfs_handle_struct *handle, const char *servi
ret = ceph_conf_read_file(cmount, NULL);
}
if (ret)
goto err_out;
if (ret) {
goto err_cm_release;
}
DBG_DEBUG( "[CEPH] calling: ceph_conf_get\n" );
ret = ceph_conf_get(cmount, "log file", buf, sizeof(buf));
if (ret < 0)
goto err_out;
if (ret < 0) {
goto err_cm_release;
}
DBG_DEBUG("[CEPH] calling: ceph_mount\n");
ret = ceph_mount(cmount, NULL);
if (ret < 0)
goto err_out;
if (ret < 0) {
goto err_cm_release;
}
/*
* encode mount context/state into our vfs/connection holding structure
@ -134,6 +136,9 @@ static int cephwrap_connect(struct vfs_handle_struct *handle, const char *servi
return 0;
err_cm_release:
ceph_release(cmount);
cmount = NULL;
err_out:
/*
* Handle the error correctly. Ceph returns -errno.