]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix update of already existing account/bucket's custom attributes. 9246/head
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Sat, 21 May 2016 00:47:12 +0000 (02:47 +0200)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Sat, 21 May 2016 00:51:42 +0000 (02:51 +0200)
Introduced in: 3f3b18bff16f6a5b36987f888ba3f2a0d1ea3155.
Fixes: http://tracker.ceph.com/issues/15977
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_op.cc

index 76a408cdcd2039be37730b23fb003f3dcc5a9991..61256c2cc4c038564cc1a78571a1eb0f961a2862 100644 (file)
@@ -1868,7 +1868,9 @@ static void prepare_add_del_attrs(const map<string, bufferlist>& orig_attrs,
           out_attrs.erase(aiter);
         }
       } else {
-        out_attrs[name] = kv.second;
+        /* emplace() won't alter the map if the key is already present.
+         * This behaviour is fully intensional here. */
+        out_attrs.emplace(kv);
       }
     } else if (out_attrs.find(name) == std::end(out_attrs)) {
       out_attrs[name] = kv.second;