]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix SnapServer crash on deleted pool 6128/head
authorJohn Spray <john.spray@redhat.com>
Tue, 29 Sep 2015 21:45:03 +0000 (22:45 +0100)
committerJohn Spray <john.spray@redhat.com>
Wed, 30 Sep 2015 12:11:16 +0000 (13:11 +0100)
Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/SnapServer.cc

index b5884fab7dce14cfa11a42b2f080bfdfbb7b9c0b..70069092c4118f3c8656c5c2fb2552b5734d547c 100644 (file)
@@ -265,6 +265,12 @@ void SnapServer::check_osd_map(bool force)
        ++p) {
     int id = p->first;
     const pg_pool_t *pi = osdmap->get_pg_pool(id);
+    if (pi == NULL) {
+      // The pool is gone.  So are the snapshots.
+      all_purged[id] = std::vector<snapid_t>(p->second.begin(), p->second.end());
+      continue;
+    }
+
     for (set<snapid_t>::iterator q = p->second.begin();
         q != p->second.end();
         ++q) {