]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: check value of config override when setting image-meta 9280/head
authorzhuangzeqiang <zhuang.zeqiang@h3c.com>
Sat, 7 Oct 2017 08:52:07 +0000 (16:52 +0800)
committerzhuangzeqiang <zhuang.zeqiang@h3c.com>
Sat, 7 Oct 2017 08:53:00 +0000 (16:53 +0800)
Fixes: http://tracker.ceph.com/issues/15522
Signed-off-by: zhuangzeqiang <zhuang.zeqiang@h3c.com>
src/librbd/internal.cc

index 5276052c5190fd18f9031b27809082663c764625..b69046b90226fe58328062ba0e4b9108709de1fd 100644 (file)
@@ -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();