mon/OSDMonitor: reject force-create-pg on pgids that shouldn't exist

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2018-02-02 11:59:29 -06:00
parent dcdb7aba28
commit 5aadca16f0

View File

@ -10927,6 +10927,11 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
err = -EINVAL;
goto reply;
}
if (!osdmap.pg_exists(pgid)) {
ss << "pg " << pgid << " should not exist";
err = -ENOENT;
goto reply;
}
bool creating_now;
{
std::lock_guard<std::mutex> l(creating_pgs_lock);