aboutsummaryrefslogtreecommitdiffstats
path: root/community/ceph/35-fix_ErasureCodeShec.patch
blob: cf991321123b2e53f18ce1e7ba59f2222106d031 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff -uNr ceph-15.2.4/src/erasure-code/shec/ErasureCodeShec.cc ceph-15.2.4-fix_ErasureCodeShec/src/erasure-code/shec/ErasureCodeShec.cc
--- ceph-15.2.4/src/erasure-code/shec/ErasureCodeShec.cc	2020-07-01 01:10:51.000000000 +0930
+++ ceph-15.2.4-fix_ErasureCodeShec/src/erasure-code/shec/ErasureCodeShec.cc	2020-11-14 00:46:20.029488684 +1030
@@ -197,7 +197,10 @@
   }
   unsigned int k = get_data_chunk_count();
   unsigned int m = get_chunk_count() - k;
-  unsigned blocksize = (*chunks.begin()).second.length();
+  unsigned blocksize = 0;
+  if (chunks.size() > 0) {
+    blocksize = (*chunks.begin()).second.length();
+  }
   for (unsigned int i =  0; i < k + m; i++) {
     if (chunks.find(i) == chunks.end()) {
       bufferlist tmp;