]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: check value of config override when setting image-meta 9554/head
authorzhuangzeqiang <zhuang.zeqiang@h3c.com>
Sat, 7 Oct 2017 08:52:07 +0000 (16:52 +0800)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Tue, 7 Jun 2016 13:51:44 +0000 (19:21 +0530)
Fixes: http://tracker.ceph.com/issues/15522
Signed-off-by: zhuangzeqiang <zhuang.zeqiang@h3c.com>
(cherry picked from commit 4538f8152d0e73bdefc09874113c87467bdda622)

src/librbd/internal.cc

index 2445bdacd3bab2964084337a4c9926f04d37690f..16124aaca530073dd56242706a08b66768748bbc 100644 (file)
@@ -2733,6 +2733,15 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force,
   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();