]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ECTransaction::get_write_plan: don't create empty to_read entries 12306/head
authorSamuel Just <sjust@redhat.com>
Wed, 30 Nov 2016 18:46:00 +0000 (10:46 -0800)
committerSamuel Just <sjust@redhat.com>
Fri, 2 Dec 2016 21:40:18 +0000 (13:40 -0800)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ECTransaction.h

index 4a92682ef052e7eb195cbb4a8fa800ca83321d05..111128d3d007f013f3d5d6f30b2e48ddb907bc17 100644 (file)
@@ -157,7 +157,14 @@ namespace ECTransaction {
        hinfo->set_projected_total_logical_size(
          sinfo,
          projected_size);
-       assert(plan.to_read[i.first].empty() || !i.second.has_source());
+
+       /* validate post conditions:
+        * to_read should have an entry for i.first iff it isn't empty
+        * and if we are reading from i.first, we can't be renaming or
+        * cloning it */
+       assert(plan.to_read.count(i.first) == 0 ||
+              (!plan.to_read.at(i.first).empty() &&
+               !i.second.has_source()));
       });
     plan.t = std::move(t);
     return plan;