Run a command: "ceph tell osd.0 query", and it outputs the following
error message:
Error EINVAL: unrecognized command! [{"prefix": "query"}]
In fact, the command "query" exists, but it requires one more input
parameter "pgid", therefore the following error information will be
more appropriate:
Error EINVAL: no pgid specified
In this patch, we check the parameter pgid after recognizing a command
(like "query" or "list_missing"), rather than before it.
Signed-off-by: Javeme <javaloveme@gmail.com>
// 'tell <pgid>' (which comes in without any of that prefix)?
else if (prefix == "pg" ||
- (cmd_getval(cct, cmdmap, "pgid", pgidstr) &&
- (prefix == "query" ||
- prefix == "mark_unfound_lost" ||
- prefix == "list_missing")
- )) {
+ prefix == "query" ||
+ prefix == "mark_unfound_lost" ||
+ prefix == "list_missing"
+ ) {
pg_t pgid;
if (!cmd_getval(cct, cmdmap, "pgid", pgidstr)) {