]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix chunked object PUT for small objects
authorYehuda Sadeh <yehuda@inktank.com>
Tue, 25 Sep 2012 22:48:23 +0000 (15:48 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Mon, 8 Oct 2012 18:25:00 +0000 (11:25 -0700)
We didn't update buffer size according to read data.
Also, didn't update the total obj_size (was doing it only
for the second chunk being put, but for chunked input that
only had a single piece we ended up with zero obj_size). Also
remove assertion that second call to handle_data() means that
ofs > chunk size. This isn't true for chunked input.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_op.cc
src/rgw/rgw_rest.cc

index 81eebee262613af14517ebd40619bbc91332df28..524e01e38b683d1689dd395acd2c79460ea6dcb3 100644 (file)
@@ -1019,9 +1019,9 @@ public:
     if (!ofs) {
       first_chunk.claim(bl);
       *phandle = NULL;
+      obj_len = (uint64_t)first_chunk.length();
       return 0;
     }
-    assert (ofs >= RGW_MAX_CHUNK_SIZE);
     int r = RGWPutObjProcessor_Aio::handle_data(bl, ofs, phandle);
 
     return r;
index f52850aa7cc01bd327a054d5424cf937407e5bba..8b35a8ae7b07c69d10799b946f0eefbe9cc19442 100644 (file)
@@ -440,7 +440,7 @@ int RGWPutObj_ObjStore::get_data(bufferlist& bl)
     len = read_len;
     if (r < 0)
       return ret;
-    bl.append(bp);
+    bl.append(bp, 0, len);
   }
 
   if ((uint64_t)ofs + len > RGW_MAX_PUT_SIZE) {