]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: PutObjMetadata, clear bufferlist before appending into it 3576/head
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 23 Sep 2014 19:42:10 +0000 (12:42 -0700)
committerLoic Dachary <ldachary@redhat.com>
Mon, 2 Feb 2015 14:41:32 +0000 (15:41 +0100)
Fixes: #9576
Backport: firefly, dumpling

We need to completely rewrite the bufferlist, not append into it.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 44cfd88dc65d30f4295743c5834768bb13f7b805)

src/rgw/rgw_op.cc

index 2ada0e678663ae4a2b377598c06428beb0f26b00..b82683416579f5ab9389f892e62da09dc7ef224c 100644 (file)
@@ -1964,6 +1964,7 @@ void RGWPutMetadata::execute()
   for (giter = s->generic_attrs.begin(); giter != s->generic_attrs.end(); ++giter) {
     bufferlist& attrbl = attrs[giter->first];
     const string& val = giter->second;
+    attrbl.clear();
     attrbl.append(val.c_str(), val.size() + 1);
   }