]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
erasure-code: bail out early if chunks to be decoded is empty
authorKefu Chai <kchai@redhat.com>
Sun, 20 Dec 2020 05:02:46 +0000 (13:02 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 20 Dec 2020 17:26:46 +0000 (01:26 +0800)
commit98e2be7f75f59ec6fbfb99e4e0b39db76a94127e
tree157497aa76bc09595c793e0126c5b3d2c98199b4
parentc471f414953a9e40d3f00f469c3540c51be9a78e
erasure-code: bail out early if chunks to be decoded is empty

otherwise we will read from uninitialized memory for blocksize.

update tests accordingly, as the number of decoded chunks is 0 if

* the number of available chunks is 0 and
* the number of requested chunks is not 0

after this change, because, in that case, the decode fails before any
chunk is allocated. but otherwise, the output chunks are still
allocated. so instead checking the number of output chunks, the test is
removed.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/erasure-code/shec/ErasureCodeShec.cc
src/test/erasure-code/TestErasureCodeShec_arguments.cc