]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix pg epoch floor tracking 2228/head
authorSage Weil <sage@redhat.com>
Fri, 8 Aug 2014 00:42:06 +0000 (17:42 -0700)
committerSage Weil <sage@redhat.com>
Fri, 8 Aug 2014 00:42:06 +0000 (17:42 -0700)
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 <sage@redhat.com>
src/osd/OSD.h

index 4608c0ff59a722e562fe22919bfdf0f9846bd90e..cfbfd120386c883e8cd5a6f1c075bd0c27a7ae4b 100644 (file)
@@ -351,7 +351,7 @@ public:
     Mutex::Locker l(pg_epoch_lock);
     map<spg_t,epoch_t>::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<spg_t,epoch_t>::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);
     }
   }