]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
erasure-code: enforce chunk size alignment
authorLoic Dachary <ldachary@redhat.com>
Tue, 2 Dec 2014 00:07:34 +0000 (01:07 +0100)
committerLoic Dachary <ldachary@redhat.com>
Thu, 4 Dec 2014 18:05:22 +0000 (19:05 +0100)
commitcc469b238f42ce989d0efa49154b95612e3d4111
tree5a14de3abe30ba2de69a2e485888b718a3865056
parent5205d4dacf7ebe2e42d2294bc30cb27f226c8d22
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>
(cherry picked from commit 4e955f41297283798236c505c3d21bdcabb5caa0)
src/erasure-code/ErasureCode.cc
src/test/erasure-code/TestErasureCode.cc