From 9001154320efcfefd60dda4006f1d0c6eec59c6d Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 29 Nov 2016 15:11:57 -0800 Subject: [PATCH] ECTransaction: fix projected_size for delete->create in get_write_plan Signed-off-by: Samuel Just --- src/osd/ECTransaction.h | 2 +- src/osd/PGTransaction.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osd/ECTransaction.h b/src/osd/ECTransaction.h index e1a18b847631a..4a92682ef052e 100644 --- a/src/osd/ECTransaction.h +++ b/src/osd/ECTransaction.h @@ -55,7 +55,7 @@ namespace ECTransaction { plan.invalidates_cache = true; } - if (i.second.is_delete()) { + if (i.second.deletes_first()) { ldpp_dout(dpp, 20) << __func__ << ": delete, setting projected size" << " to 0" << dendl; projected_size = 0; diff --git a/src/osd/PGTransaction.h b/src/osd/PGTransaction.h index a8c0608cc764f..bf8cb6a3f4898 100644 --- a/src/osd/PGTransaction.h +++ b/src/osd/PGTransaction.h @@ -83,6 +83,9 @@ public: * ECBackend transaction planning needs this context * to figure out how to perform the transaction. */ + bool deletes_first() const { + return delete_first; + } bool is_delete() const { return boost::get(&init_type) != nullptr && delete_first; } -- 2.39.5