erasure-code: fix assert overflow

If the file size does not fit in 32 bits the (unsigned) cast will
overflow. Cast to uint64_t which is the type of the value returned by
get_total_chunk_size.

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

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
This commit is contained in:
Loic Dachary 2014-09-19 16:13:53 +02:00
parent 0519225beb
commit f51e368f98

View File

@ -1456,7 +1456,7 @@ ECUtil::HashInfoRef ECBackend::get_hash_info(
if (r >= 0) {
bufferlist::iterator bp = bl.begin();
::decode(hinfo, bp);
assert(hinfo.get_total_chunk_size() == (unsigned)st.st_size);
assert(hinfo.get_total_chunk_size() == (uint64_t)st.st_size);
} else {
assert(0 == "missing hash attr");
}