]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
osd: Do not do a read-modify-write if op.delete_first is set
authorAlex Ainscow <aainscow@uk.ibm.com>
Wed, 7 May 2025 09:33:24 +0000 (10:33 +0100)
committerLaura Flores <lflores@ibm.com>
Wed, 9 Jul 2025 15:47:25 +0000 (15:47 +0000)
commita99491ecfab623058883f19ac303f457762ad1b6
tree98fe795155cd8a7a88f2fdda444f1bb3c822a271
parent90627f4ec002536c29b6551a07186df83689da1e
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)
src/osd/ECTransaction.cc
src/test/osd/test_ec_transaction.cc