bufferlist::iterator p = bl.begin();
inc.decode(p);
- osdmap->apply_incremental(inc);
+ if (osdmap->apply_incremental(inc)) {
+ //error out!
+ dout(0) << "ERROR: Got non-matching FSID from trusted source!" << dendl;
+ session->put();
+ m->put();
+ shutdown();
+ }
// archive the full map
bl.clear();
}
- void apply_incremental(Incremental &inc) {
+ int apply_incremental(Incremental &inc) {
if (inc.epoch == 1)
fsid = inc.fsid;
else
- assert(ceph_fsid_compare(&inc.fsid, &fsid) == 0);
+ if (ceph_fsid_compare(&inc.fsid, &fsid) == 0) {
+ return -EINVAL;
+ }
assert(inc.epoch == epoch+1);
epoch++;
modified = inc.modified;
// full map?
if (inc.fullmap.length()) {
decode(inc.fullmap);
- return;
+ return 0;
}
// nope, incremental.
bufferlist::iterator blp = inc.crush.begin();
crush.decode(blp);
}
+ return 0;
}
// serialize, unserialize