From: Loic Dachary Date: Fri, 19 Sep 2014 14:13:53 +0000 (+0200) Subject: erasure-code: fix assert overflow X-Git-Tag: v0.86~41^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2534%2Fhead;p=ceph.git 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 --- diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index a87b5b4ec1df..1497f7e2bd4d 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -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"); }