From: Yehuda Sadeh Date: Thu, 24 Jul 2014 22:30:27 +0000 (-0700) Subject: rgw: object write should not exceed part size X-Git-Tag: v0.80.6~103^2~2^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4cd1b60c043089358ea8e70a51310005d5b68383;p=ceph.git rgw: object write should not exceed part size Fixes: #8928 This can happen if the stripe size is not a multiple of the chunk size. Backport: firefly Signed-off-by: Yehuda Sadeh (cherry picked from commit 14cad5ece7d1de9d93e72acca6d4c3b4a9cfcfa2) --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 2914047f6268..5a62e738caec 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -1044,11 +1044,13 @@ int RGWPutObjProcessor_Atomic::handle_data(bufferlist& bl, off_t ofs, void **pha } } + uint64_t max_write_size = MIN(max_chunk_size, (uint64_t)next_part_ofs - data_ofs); + pending_data_bl.claim_append(bl); - if (pending_data_bl.length() < max_chunk_size) + if (pending_data_bl.length() < max_write_size) return 0; - pending_data_bl.splice(0, max_chunk_size, &bl); + pending_data_bl.splice(0, max_write_size, &bl); if (!data_ofs && !immutable_head()) { first_chunk.claim(bl);