The g_conf() will try to dereference the "g_ceph_context" to get
the "_conf", but the "g_ceph_context" won't be set in none fuse
use case in libcephfs, so it will crash in when doing
g_conf().get_val<>.
Switch to use cct->_conf.get_val<> instead.
Fixes: https://tracker.ceph.com/issues/48206
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit
a467274f1c4dcf357de48fb736d40f7488bc4d7c)
int Client::_do_remount(bool retry_on_error)
{
- uint64_t max_retries = g_conf().get_val<uint64_t>("mds_max_retries_on_remount_failure");
+ uint64_t max_retries = cct->_conf.get_val<uint64_t>("mds_max_retries_on_remount_failure");
errno = 0;
int r = remount_cb(callback_handle);
static void get_fuse_groups(UserPerm& perms, fuse_req_t req)
{
- if (g_conf().get_val<bool>("fuse_set_user_groups")) {
+ CephFuse::Handle *cfuse = (CephFuse::Handle *)fuse_req_userdata(req);
+ if (cfuse->client->cct->_conf.get_val<bool>("fuse_set_user_groups")) {
gid_t *gids = NULL;
int count = getgroups(req, &gids);