osd: Do not do a read-modify-write if op.delete_first is set
Some client OPs are able to generate transactions which delete an
object and then write it again. This is used by the copy-from ops.
If such a write is not 4k aligned, then the new EC code was incorrectly doing
a read-modify write on the misaligned 4k. This causes some
garbage to be written to the backend OSD, off the end of the
object. This is only a problem if the object is later extended
without the end being written.
Problematic sequence is:
1. Create two objects (A and B) of size X and Y where:
X > Y, (Y % 4096) != 0
2. copy_from OP B -> A
3. Extend B without writing offset Y+1
This will result in a corrupt data buffer at Y+1 without this fix.
Signed-off-by: Alex Ainscow <aainscow@uk.ibm.com>
(cherry picked from commit
dafe15ec4d7fd6c7deb77cfa00a3e737c71545dc)