osd: trim copy-get backend read to object size
We are passing a big number to the backend to read and it is trimming it
to the stripe boundary, and then setting the cursor at a slightly smaller
offset bound by oi.size. This is invalid, and will trigger an assert in
the _write_copy_chunk code:
0> 2014-03-21 15:12:23.761509
7f8dd2324700 -1 osd/ReplicatedPG.cc: In function 'void ReplicatedPG::_write_copy_chunk(ReplicatedPG::CopyOpRef, PGBackend::PGTransaction*)' thread
7f8dd2324700 time 2014-03-21 15:12:23.758866
osd/ReplicatedPG.cc: 5554: FAILED assert(cop->data.length() + cop->temp_cursor.data_offset == cop->cursor.data_offset)
To fix this, trim the buffer to the correct length in the completion
context.
Fixes: #7823
Signed-off-by: Sage Weil <sage@inktank.com>