From: xie xingguo Date: Wed, 25 Jul 2018 08:04:53 +0000 (+0800) Subject: osd/PG: clear missing_loc properly if last location is gone X-Git-Tag: v14.0.1~721^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=72d8a6acf94cfd3807199895b82e983cb114c89e;p=ceph.git osd/PG: clear missing_loc properly if last location is gone Signed-off-by: xie xingguo --- diff --git a/src/osd/PG.h b/src/osd/PG.h index 9a4ee13a9fb..39a40b13a53 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); + } } }