diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2013-06-17 17:14:22 -0700 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2013-06-17 17:14:22 -0700 |
commit | 7f63baa68c2334d9e47f1393ff868a90979f0bc2 (patch) | |
tree | 10c38bf5ff6dfa1a212f0afbb060e1a516731b9d | |
parent | 94b3700501258a3de54ec91bd4c8874484b32ede (diff) | |
download | ceph-7f63baa68c2334d9e47f1393ff868a90979f0bc2.tar.gz |
rgw: fix inter-region copy (ofs wasn't correct)
Fixing an issue with data read. Since inter-region copy uses
embedded metadata within the data input, we need to fix the ofs
accordingly.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r-- | src/rgw/rgw_rados.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index ff164b183de..1b3db4b2cce 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -620,19 +620,22 @@ int RGWPutObjProcessor_Atomic::handle_data(bufferlist& bl, off_t ofs, void **pha extra_data_bl.append(extra); extra_data_len -= extra_len; - if (bl.length() == 0) + if (bl.length() == 0) { return 0; + } + ofs = extra_data_bl.length(); } - if (!ofs && !immutable_head()) { + off_t actual_ofs = ofs - extra_data_bl.length(); + if (!actual_ofs && !immutable_head()) { first_chunk.claim(bl); *phandle = NULL; obj_len = (uint64_t)first_chunk.length(); prepare_next_part(first_chunk.length()); return 0; } - if (ofs >= next_part_ofs) - prepare_next_part(ofs); - int r = RGWPutObjProcessor_Aio::handle_obj_data(cur_obj, bl, ofs - cur_part_ofs, ofs, phandle); + if (actual_ofs >= next_part_ofs) + prepare_next_part(actual_ofs); + int r = RGWPutObjProcessor_Aio::handle_obj_data(cur_obj, bl, actual_ofs - cur_part_ofs, actual_ofs, phandle); return r; } |