From: David Zafman Date: Sat, 1 Aug 2015 01:44:56 +0000 (-0700) Subject: osd: Avoid confusion by changing EC decode total_chunk_size to total_data_size X-Git-Tag: v9.1.0~244^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1febe89d926803a58bbef648804dd6aa8c2ea131;p=ceph.git osd: Avoid confusion by changing EC decode total_chunk_size to total_data_size The length of the buffers being decoded may only be part of the chunk, so less than the HashInfo total_chunk_size. Signed-off-by: David Zafman --- diff --git a/src/osd/ECUtil.cc b/src/osd/ECUtil.cc index 1f3b45857da8..9d2c2fb261e9 100644 --- a/src/osd/ECUtil.cc +++ b/src/osd/ECUtil.cc @@ -10,23 +10,23 @@ int ECUtil::decode( map &to_decode, bufferlist *out) { - uint64_t total_chunk_size = to_decode.begin()->second.length(); + uint64_t total_data_size = to_decode.begin()->second.length(); assert(to_decode.size()); - assert(total_chunk_size % sinfo.get_chunk_size() == 0); + assert(total_data_size % sinfo.get_chunk_size() == 0); assert(out); assert(out->length() == 0); for (map::iterator i = to_decode.begin(); i != to_decode.end(); ++i) { - assert(i->second.length() == total_chunk_size); + assert(i->second.length() == total_data_size); } - if (total_chunk_size == 0) + if (total_data_size == 0) return 0; - for (uint64_t i = 0; i < total_chunk_size; i += sinfo.get_chunk_size()) { + for (uint64_t i = 0; i < total_data_size; i += sinfo.get_chunk_size()) { map chunks; for (map::iterator j = to_decode.begin(); j != to_decode.end(); @@ -48,18 +48,18 @@ int ECUtil::decode( map &to_decode, map &out) { - uint64_t total_chunk_size = to_decode.begin()->second.length(); + uint64_t total_data_size = to_decode.begin()->second.length(); assert(to_decode.size()); - assert(total_chunk_size % sinfo.get_chunk_size() == 0); + assert(total_data_size % sinfo.get_chunk_size() == 0); for (map::iterator i = to_decode.begin(); i != to_decode.end(); ++i) { - assert(i->second.length() == total_chunk_size); + assert(i->second.length() == total_data_size); } - if (total_chunk_size == 0) + if (total_data_size == 0) return 0; set need; @@ -71,7 +71,7 @@ int ECUtil::decode( need.insert(i->first); } - for (uint64_t i = 0; i < total_chunk_size; i += sinfo.get_chunk_size()) { + for (uint64_t i = 0; i < total_data_size; i += sinfo.get_chunk_size()) { map chunks; for (map::iterator j = to_decode.begin(); j != to_decode.end(); @@ -92,7 +92,7 @@ int ECUtil::decode( for (map::iterator i = out.begin(); i != out.end(); ++i) { - assert(i->second->length() == total_chunk_size); + assert(i->second->length() == total_data_size); } return 0; }