]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: fix assert overflow 2534/head
authorLoic Dachary <loic-201408@dachary.org>
Fri, 19 Sep 2014 14:13:53 +0000 (16:13 +0200)
committerLoic Dachary <loic-201408@dachary.org>
Fri, 19 Sep 2014 14:16:44 +0000 (16:16 +0200)
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>
src/osd/ECBackend.cc

index a87b5b4ec1df9a7908e8b924ba053ed9e26cd768..1497f7e2bd4d38b7a1f1796443cc8c81144e0394 100644 (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");
       }