From 72d8a6acf94cfd3807199895b82e983cb114c89e Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Wed, 25 Jul 2018 16:04:53 +0800 Subject: [PATCH] osd/PG: clear missing_loc properly if last location is gone Signed-off-by: xie xingguo --- src/osd/PG.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osd/PG.h b/src/osd/PG.h index 9a4ee13a9fba..39a40b13a53e 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -786,7 +786,11 @@ protected: if (p != missing_loc.end()) { _dec_count(p->second); p->second.erase(location); - _inc_count(p->second); + if (p->second.empty()) { + missing_loc.erase(p); + } else { + _inc_count(p->second); + } } } -- 2.47.3