mirror of
https://github.com/ceph/ceph
synced 2024-12-19 01:46:00 +00:00
mon: OSDMonitor: reply ENOENT if specified osd does not exist
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
This commit is contained in:
parent
2bba53f457
commit
fd6c023f49
@ -1374,6 +1374,7 @@ function test_mon_pg()
|
||||
|
||||
ceph osd primary-affinity osd.0 .9
|
||||
expect_false ceph osd primary-affinity osd.0 -2
|
||||
expect_false ceph osd primary-affinity osd.9999 .5
|
||||
ceph osd primary-affinity osd.0 1
|
||||
|
||||
ceph osd pg-temp 0.0 0 1 2
|
||||
|
@ -6546,6 +6546,10 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
|
||||
wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
|
||||
get_last_committed() + 1));
|
||||
return true;
|
||||
} else {
|
||||
ss << "osd." << id << " does not exist";
|
||||
err = -ENOENT;
|
||||
goto reply;
|
||||
}
|
||||
} else if (prefix == "osd reweight") {
|
||||
int64_t id;
|
||||
@ -6575,8 +6579,11 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
|
||||
wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
|
||||
get_last_committed() + 1));
|
||||
return true;
|
||||
} else {
|
||||
ss << "osd." << id << " does not exist";
|
||||
err = -ENOENT;
|
||||
goto reply;
|
||||
}
|
||||
|
||||
} else if (prefix == "osd lost") {
|
||||
int64_t id;
|
||||
if (!cmd_getval(g_ceph_context, cmdmap, "id", id)) {
|
||||
|
Loading…
Reference in New Issue
Block a user