]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.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)
committerAlex Ainscow <aainscow@uk.ibm.com>
Tue, 1 Jul 2025 12:03:30 +0000 (13:03 +0100)
commitdafe15ec4d7fd6c7deb77cfa00a3e737c71545dc
tree61cfa76749e85e437988f90ef0d16614b66be6c5
parent2a569d8680ff64287efea5d4b1790b396aae86cc
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>
src/osd/ECTransaction.cc
src/test/osd/test_ec_transaction.cc