class MPGStats : public Message {
public:
+ ceph_fsid fsid;
map<pg_t,pg_stat_t> pg_stat;
osd_stat_t osd_stat;
MPGStats() : Message(MSG_PGSTATS) {}
+ MPGStats(ceph_fsid& f) : Message(MSG_PGSTATS), fsid(f) {}
const char *get_type_name() { return "pg_stats"; }
void print(ostream& out) {
}
void encode_payload() {
+ ::encode(fsid, payload);
::encode(osd_stat, payload);
::encode(pg_stat, payload);
}
void decode_payload() {
bufferlist::iterator p = payload.begin();
+ ::decode(fsid, p);
::decode(osd_stat, p);
::decode(pg_stat, p);
}
{
dout(10) << "prepare_pg_stats " << *stats << " from " << stats->get_orig_source() << dendl;
int from = stats->get_orig_source().num();
+
+ if (!ceph_fsid_equal(&stats->fsid, &mon->monmap->fsid)) {
+ dout(0) << "handle_statfs on fsid " << stats->fsid << " != " << mon->monmap->fsid << dendl;
+ delete stats;
+ return false;
+ }
if (!stats->get_orig_source().is_osd() ||
!mon->osdmon->osdmap.is_up(from) ||
stats->get_orig_source_inst() != mon->osdmon->osdmap.get_inst(from)) {
dout(1) << " ignoring stats from non-active osd" << dendl;
+ delete stats;
+ return false;
}
// osd stat
if (!pg_stat_pending.empty() || osd_stat_pending) {
dout(1) << "send_pg_stats - " << pg_stat_pending.size() << " pgs updated" << dendl;
- MPGStats *m = new MPGStats;
+ MPGStats *m = new MPGStats(osdmap->get_fsid());
for (map<pg_t,eversion_t>::iterator p = pg_stat_pending.begin();
p != pg_stat_pending.end();
p++) {