From 6772c40c672483be5336779280a7acfb58b46023 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Fri, 28 Aug 2020 10:02:47 -0700 Subject: [PATCH] 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 --- src/mon/MgrStatMonitor.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; } -- 2.47.3