]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
erasure-code: enforce chunk size alignment 3049/head
authorLoic Dachary <ldachary@redhat.com>
Tue, 2 Dec 2014 00:07:34 +0000 (01:07 +0100)
committerLoic Dachary <ldachary@redhat.com>
Tue, 2 Dec 2014 20:15:26 +0000 (21:15 +0100)
commit4e955f41297283798236c505c3d21bdcabb5caa0
treeb98d7e90d4d3add912a6a88428c5601154eba56c
parent73ad2d63d479b09037d50246106bbd4075fbce80
erasure-code: enforce chunk size alignment

Let say the ErasureCode::encode function is given a 4096 bytes
bufferlist made of a 1249 bytes bufferptr followed by a 2847 bytes
bufferptr, both properly starting on SIMD_ALIGN address. As a result the
second 2048 had to be reallocated when bufferlist::substr_of gets the
second 2048 buffer, the address starts at 799 bytes after the beginning
of the 2847 buffer ptr and is not SIMD_ALIGN'ed.

The ErasureCode::encode must enforce a size alignment based on the chunk
size in addition to the memory alignment required by SIMD operations,
using the bufferlist::rebuild_aligned_size_and_memory function instead of
bufferlist::rebuild_aligned.

http://tracker.ceph.com/issues/10211 Fixes: #10211

Signed-off-by: Loic Dachary <loic@dachary.org>
src/erasure-code/ErasureCode.cc
src/test/erasure-code/TestErasureCode.cc