From 9ee54723c83793175c2916c10fcdde8362966324 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 30 Nov 2016 10:46:00 -0800 Subject: [PATCH] ECTransaction::get_write_plan: don't create empty to_read entries Signed-off-by: Samuel Just --- src/osd/ECTransaction.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; -- 2.47.3