]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: ignore statfs requests on invalid poolid 36885/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 28 Aug 2020 17:02:47 +0000 (10:02 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Sat, 29 Aug 2020 17:22:12 +0000 (10:22 -0700)
Otherwise, we'll see a SIGSEGV when trying to get the size in
get_pool_free_space.

Fixes: https://tracker.ceph.com/issues/47182
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mon/MgrStatMonitor.cc

index 9eca4b469ddae59eb3136ef384aa3be4e9e7a5a6..b757f24dd880ef29d92dfa0a47f51ccf35de7f7a 100644 (file)
@@ -305,11 +305,18 @@ bool MgrStatMonitor::preprocess_statfs(MonOpRequestRef op)
             << " != " << mon->monmap->fsid << dendl;
     return true;
   }
+  const auto& pool = statfs->data_pool;
+  if (pool && !mon->osdmon()->osdmap.have_pg_pool(*pool)) {
+    // There's no error field for MStatfsReply so just ignore the request.
+    // This is known to happen when a client is still accessing a removed fs.
+    dout(1) << __func__ << " on removed pool " << *pool << dendl;
+    return true;
+  }
   dout(10) << __func__ << " " << *statfs
            << " from " << statfs->get_orig_source() << dendl;
   epoch_t ver = get_last_committed();
   auto reply = new MStatfsReply(statfs->fsid, statfs->get_tid(), ver);
-  reply->h.st = get_statfs(mon->osdmon()->osdmap, statfs->data_pool);
+  reply->h.st = get_statfs(mon->osdmon()->osdmap, pool);
   mon->send_reply(op, reply);
   return true;
 }