From f51e368f98fb17b2460dcab717424194d7100432 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Fri, 19 Sep 2014 16:13:53 +0200 Subject: [PATCH] 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 --- src/osd/ECBackend.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); } -- 2.47.3