MCPcopy Create free account
hub / github.com/ceph/ceph / preprocess_statfs

Method preprocess_statfs

src/mon/MgrStatMonitor.cc:484–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

482}
483
484bool MgrStatMonitor::preprocess_statfs(MonOpRequestRef op)
485{
486 op->mark_pgmon_event(__func__);
487 auto statfs = op->get_req<MStatfs>();
488 auto session = op->get_session();
489
490 if (!session)
491 return true;
492 if (!session->is_capable("pg", MON_CAP_R)) {
493 dout(0) << "MStatfs received from entity with insufficient privileges "
494 << session->caps << dendl;
495 return true;
496 }
497 if (statfs->fsid != mon.monmap->fsid) {
498 dout(0) << __func__ << " on fsid " << statfs->fsid
499 << " != " << mon.monmap->fsid << dendl;
500 return true;
501 }
502 const auto& pool = statfs->data_pool;
503 if (pool && !mon.osdmon()->osdmap.have_pg_pool(*pool)) {
504 // There's no error field for MStatfsReply so just ignore the request.
505 // This is known to happen when a client is still accessing a removed fs.
506 dout(1) << __func__ << " on removed pool " << *pool << dendl;
507 return true;
508 }
509 dout(10) << __func__ << " " << *statfs
510 << " from " << statfs->get_orig_source() << dendl;
511 epoch_t ver = get_last_committed();
512 auto reply = new MStatfsReply(statfs->fsid, statfs->get_tid(), ver);
513 reply->h.st = get_statfs(mon.osdmon()->osdmap, pool);
514 mon.send_reply(op, reply);
515 return true;
516}
517
518void MgrStatMonitor::check_sub(Subscription *sub)
519{

Callers

nothing calls this directly

Calls 8

mark_pgmon_eventMethod · 0.80
have_pg_poolMethod · 0.80
osdmonMethod · 0.80
get_orig_sourceMethod · 0.80
send_replyMethod · 0.80
get_sessionMethod · 0.45
is_capableMethod · 0.45
get_tidMethod · 0.45

Tested by

no test coverage detected