| 3914 | // alive |
| 3915 | |
| 3916 | bool OSDMonitor::preprocess_alive(MonOpRequestRef op) |
| 3917 | { |
| 3918 | op->mark_osdmon_event(__func__); |
| 3919 | auto m = op->get_req<MOSDAlive>(); |
| 3920 | int from = m->get_orig_source().num(); |
| 3921 | |
| 3922 | // check permissions, ignore if failed |
| 3923 | MonSession *session = op->get_session(); |
| 3924 | if (!session) |
| 3925 | goto ignore; |
| 3926 | if (!session->is_capable("osd", MON_CAP_X)) { |
| 3927 | dout(0) << "attempt to send MOSDAlive from entity with insufficient privileges:" |
| 3928 | << session->caps << dendl; |
| 3929 | goto ignore; |
| 3930 | } |
| 3931 | |
| 3932 | if (!osdmap.is_up(from) || |
| 3933 | !osdmap.get_addrs(from).legacy_equals(m->get_orig_source_addrs())) { |
| 3934 | dout(7) << "preprocess_alive ignoring alive message from down " |
| 3935 | << m->get_orig_source() << " " << m->get_orig_source_addrs() |
| 3936 | << dendl; |
| 3937 | goto ignore; |
| 3938 | } |
| 3939 | |
| 3940 | if (osdmap.get_up_thru(from) >= m->want) { |
| 3941 | // yup. |
| 3942 | dout(7) << "preprocess_alive want up_thru " << m->want << " dup from " << m->get_orig_source_inst() << dendl; |
| 3943 | _reply_map(op, m->version); |
| 3944 | return true; |
| 3945 | } |
| 3946 | |
| 3947 | dout(10) << "preprocess_alive want up_thru " << m->want |
| 3948 | << " from " << m->get_orig_source_inst() << dendl; |
| 3949 | return false; |
| 3950 | |
| 3951 | ignore: |
| 3952 | mon.no_reply(op); |
| 3953 | return true; |
| 3954 | } |
| 3955 | |
| 3956 | bool OSDMonitor::prepare_alive(MonOpRequestRef op) |
| 3957 | { |
nothing calls this directly
no test coverage detected