80da5f9a987c6a48b93f25228fdac85890013520 exposed a flaw in how
handle_osd_map falls back to a full osdmap if the crc of an incremental
failed.
If the first message in a map message had a crc error, then the
loop would exit with last < start, which would then cause a null
dereference in _committed_osd_maps.
Fixes: https://tracker.ceph.com/issues/46443
Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
(cherry picked from commit
99463cb523949289384a6210ea250114fbe852f4)
delete o;
request_full_map(e, last);
last = e - 1;
+
+ // don't continue committing if we failed to enc the first inc map
+ if (last < start) {
+ dout(10) << __func__ << " bailing because last < start (" << last << "<" << start << ")" << dendl;
+ m->put();
+ return;
+ }
break;
}
got_full_map(e);
}
map_lock.get_write();
+ ceph_assert(first <= last);
+
bool do_shutdown = false;
bool do_restart = false;
bool network_error = false;
- OSDMapRef osdmap;
+ OSDMapRef osdmap = get_osdmap();
// advance through the new maps
for (epoch_t cur = first; cur <= last; cur++) {