From: Samuel Just Date: Wed, 30 Nov 2016 18:46:00 +0000 (-0800) Subject: ECTransaction::get_write_plan: don't create empty to_read entries X-Git-Tag: v11.1.0~59^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F12306%2Fhead;p=ceph.git ECTransaction::get_write_plan: don't create empty to_read entries Signed-off-by: Samuel Just --- diff --git a/src/osd/ECTransaction.h b/src/osd/ECTransaction.h index 4a92682ef052..111128d3d007 100644 --- a/src/osd/ECTransaction.h +++ b/src/osd/ECTransaction.h @@ -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;