From a52a855f6c92b03dd84cd0cc1759084f070a98c2 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 7 Aug 2014 17:42:06 -0700 Subject: [PATCH] osd: fix pg epoch floor tracking If you call erase() on a multiset it will delete all instances of a value; we only want to delete one of them. Fix this by passing an iterator. Backport: firefly Signed-off-by: Sage Weil --- src/osd/OSD.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 4608c0ff59a72..cfbfd120386c8 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -351,7 +351,7 @@ public: Mutex::Locker l(pg_epoch_lock); map::iterator t = pg_epoch.find(pgid); assert(t != pg_epoch.end()); - pg_epochs.erase(t->second); + pg_epochs.erase(pg_epochs.find(t->second)); t->second = epoch; pg_epochs.insert(epoch); } @@ -359,7 +359,7 @@ public: Mutex::Locker l(pg_epoch_lock); map::iterator t = pg_epoch.find(pgid); if (t != pg_epoch.end()) { - pg_epochs.erase(t->second); + pg_epochs.erase(pg_epochs.find(t->second)); pg_epoch.erase(t); } } -- 2.39.5