]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix update of already existing account/bucket's custom attributes. 9542/head
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Sat, 21 May 2016 00:47:12 +0000 (02:47 +0200)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Tue, 7 Jun 2016 13:05:11 +0000 (18:35 +0530)
Introduced in: 3f3b18bff16f6a5b36987f888ba3f2a0d1ea3155.
Fixes: http://tracker.ceph.com/issues/15977
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
(cherry picked from commit d6129e664fc8d25e70bfaf83e340703005f8f73f)

src/rgw/rgw_op.cc

index 30764799a76f4e6cc4c61aba849c8ca2bb7e5821..0c22e894fadefdb4f51c8a750d50ec35cd573745 100644 (file)
@@ -1857,7 +1857,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;