From: Patrick Donnelly Date: Fri, 28 Aug 2020 17:02:47 +0000 (-0700) Subject: mon: ignore statfs requests on invalid poolid X-Git-Tag: v16.1.0~1264^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F36885%2Fhead;p=ceph.git mon: ignore statfs requests on invalid poolid 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 --- diff --git a/src/mon/MgrStatMonitor.cc b/src/mon/MgrStatMonitor.cc index 9eca4b469dda..b757f24dd880 100644 --- a/src/mon/MgrStatMonitor.cc +++ b/src/mon/MgrStatMonitor.cc @@ -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; }