mirror of
https://github.com/ceph/ceph
synced 2024-12-23 20:03:56 +00:00
rbd: check value of config override when setting image-meta
Fixes: http://tracker.ceph.com/issues/15522 Signed-off-by: zhuangzeqiang <zhuang.zeqiang@h3c.com>
This commit is contained in:
parent
b7afa78e22
commit
4538f8152d
@ -2627,6 +2627,15 @@ remove_mirroring_image:
|
||||
int metadata_set(ImageCtx *ictx, const string &key, const string &value)
|
||||
{
|
||||
CephContext *cct = ictx->cct;
|
||||
string start = ictx->METADATA_CONF_PREFIX;
|
||||
size_t conf_prefix_len = start.size();
|
||||
|
||||
if(key.size() > conf_prefix_len && !key.compare(0,conf_prefix_len,start)) {
|
||||
string subkey = key.substr(conf_prefix_len, key.size()-conf_prefix_len);
|
||||
int r = cct->_conf->set_val(subkey.c_str(), value);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
ldout(cct, 20) << "metadata_set " << ictx << " key=" << key << " value=" << value << dendl;
|
||||
|
||||
int r = ictx->state->refresh_if_required();
|
||||
|
Loading…
Reference in New Issue
Block a user