Commit 4151dd9a authored by Parav Pandit's avatar Parav Pandit Committed by Jens Axboe

nvmet: Fixed avoided printing nvmet: twice in error logs.

This patch avoids printing "nvmet:" twice in error logs as its already
coming through pr_fmt macro.
Reviewed-by: default avatarMax Gurtovoy <maxg@mellanox.com>
Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 4459e042
...@@ -487,13 +487,13 @@ int nvmet_parse_admin_cmd(struct nvmet_req *req) ...@@ -487,13 +487,13 @@ int nvmet_parse_admin_cmd(struct nvmet_req *req)
req->ns = NULL; req->ns = NULL;
if (unlikely(!(req->sq->ctrl->cc & NVME_CC_ENABLE))) { if (unlikely(!(req->sq->ctrl->cc & NVME_CC_ENABLE))) {
pr_err("nvmet: got admin cmd %d while CC.EN == 0\n", pr_err("got admin cmd %d while CC.EN == 0\n",
cmd->common.opcode); cmd->common.opcode);
return NVME_SC_CMD_SEQ_ERROR | NVME_SC_DNR; return NVME_SC_CMD_SEQ_ERROR | NVME_SC_DNR;
} }
if (unlikely(!(req->sq->ctrl->csts & NVME_CSTS_RDY))) { if (unlikely(!(req->sq->ctrl->csts & NVME_CSTS_RDY))) {
pr_err("nvmet: got admin cmd %d while CSTS.RDY == 0\n", pr_err("got admin cmd %d while CSTS.RDY == 0\n",
cmd->common.opcode); cmd->common.opcode);
return NVME_SC_CMD_SEQ_ERROR | NVME_SC_DNR; return NVME_SC_CMD_SEQ_ERROR | NVME_SC_DNR;
} }
...@@ -545,6 +545,6 @@ int nvmet_parse_admin_cmd(struct nvmet_req *req) ...@@ -545,6 +545,6 @@ int nvmet_parse_admin_cmd(struct nvmet_req *req)
return 0; return 0;
} }
pr_err("nvmet: unhandled cmd %d\n", cmd->common.opcode); pr_err("unhandled cmd %d\n", cmd->common.opcode);
return NVME_SC_INVALID_OPCODE | NVME_SC_DNR; return NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
} }
...@@ -273,8 +273,8 @@ int nvmet_ns_enable(struct nvmet_ns *ns) ...@@ -273,8 +273,8 @@ int nvmet_ns_enable(struct nvmet_ns *ns)
ns->bdev = blkdev_get_by_path(ns->device_path, FMODE_READ | FMODE_WRITE, ns->bdev = blkdev_get_by_path(ns->device_path, FMODE_READ | FMODE_WRITE,
NULL); NULL);
if (IS_ERR(ns->bdev)) { if (IS_ERR(ns->bdev)) {
pr_err("nvmet: failed to open block device %s: (%ld)\n", pr_err("failed to open block device %s: (%ld)\n",
ns->device_path, PTR_ERR(ns->bdev)); ns->device_path, PTR_ERR(ns->bdev));
ret = PTR_ERR(ns->bdev); ret = PTR_ERR(ns->bdev);
ns->bdev = NULL; ns->bdev = NULL;
goto out_unlock; goto out_unlock;
......
...@@ -166,8 +166,8 @@ int nvmet_parse_discovery_cmd(struct nvmet_req *req) ...@@ -166,8 +166,8 @@ int nvmet_parse_discovery_cmd(struct nvmet_req *req)
req->ns = NULL; req->ns = NULL;
if (unlikely(!(req->sq->ctrl->csts & NVME_CSTS_RDY))) { if (unlikely(!(req->sq->ctrl->csts & NVME_CSTS_RDY))) {
pr_err("nvmet: got cmd %d while not ready\n", pr_err("got cmd %d while not ready\n",
cmd->common.opcode); cmd->common.opcode);
return NVME_SC_INVALID_OPCODE | NVME_SC_DNR; return NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
} }
...@@ -180,8 +180,8 @@ int nvmet_parse_discovery_cmd(struct nvmet_req *req) ...@@ -180,8 +180,8 @@ int nvmet_parse_discovery_cmd(struct nvmet_req *req)
req->execute = nvmet_execute_get_disc_log_page; req->execute = nvmet_execute_get_disc_log_page;
return 0; return 0;
default: default:
pr_err("nvmet: unsupported get_log_page lid %d\n", pr_err("unsupported get_log_page lid %d\n",
cmd->get_log_page.lid); cmd->get_log_page.lid);
return NVME_SC_INVALID_OPCODE | NVME_SC_DNR; return NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
} }
case nvme_admin_identify: case nvme_admin_identify:
...@@ -192,17 +192,16 @@ int nvmet_parse_discovery_cmd(struct nvmet_req *req) ...@@ -192,17 +192,16 @@ int nvmet_parse_discovery_cmd(struct nvmet_req *req)
nvmet_execute_identify_disc_ctrl; nvmet_execute_identify_disc_ctrl;
return 0; return 0;
default: default:
pr_err("nvmet: unsupported identify cns %d\n", pr_err("unsupported identify cns %d\n",
cmd->identify.cns); cmd->identify.cns);
return NVME_SC_INVALID_OPCODE | NVME_SC_DNR; return NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
} }
default: default:
pr_err("nvmet: unsupported cmd %d\n", pr_err("unsupported cmd %d\n", cmd->common.opcode);
cmd->common.opcode);
return NVME_SC_INVALID_OPCODE | NVME_SC_DNR; return NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
} }
pr_err("nvmet: unhandled cmd %d\n", cmd->common.opcode); pr_err("unhandled cmd %d\n", cmd->common.opcode);
return NVME_SC_INVALID_OPCODE | NVME_SC_DNR; return NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
} }
......
...@@ -201,15 +201,15 @@ int nvmet_parse_io_cmd(struct nvmet_req *req) ...@@ -201,15 +201,15 @@ int nvmet_parse_io_cmd(struct nvmet_req *req)
struct nvme_command *cmd = req->cmd; struct nvme_command *cmd = req->cmd;
if (unlikely(!(req->sq->ctrl->cc & NVME_CC_ENABLE))) { if (unlikely(!(req->sq->ctrl->cc & NVME_CC_ENABLE))) {
pr_err("nvmet: got io cmd %d while CC.EN == 0\n", pr_err("got io cmd %d while CC.EN == 0\n",
cmd->common.opcode); cmd->common.opcode);
req->ns = NULL; req->ns = NULL;
return NVME_SC_CMD_SEQ_ERROR | NVME_SC_DNR; return NVME_SC_CMD_SEQ_ERROR | NVME_SC_DNR;
} }
if (unlikely(!(req->sq->ctrl->csts & NVME_CSTS_RDY))) { if (unlikely(!(req->sq->ctrl->csts & NVME_CSTS_RDY))) {
pr_err("nvmet: got io cmd %d while CSTS.RDY == 0\n", pr_err("got io cmd %d while CSTS.RDY == 0\n",
cmd->common.opcode); cmd->common.opcode);
req->ns = NULL; req->ns = NULL;
return NVME_SC_CMD_SEQ_ERROR | NVME_SC_DNR; return NVME_SC_CMD_SEQ_ERROR | NVME_SC_DNR;
} }
...@@ -237,7 +237,7 @@ int nvmet_parse_io_cmd(struct nvmet_req *req) ...@@ -237,7 +237,7 @@ int nvmet_parse_io_cmd(struct nvmet_req *req)
req->execute = nvmet_execute_write_zeroes; req->execute = nvmet_execute_write_zeroes;
return 0; return 0;
default: default:
pr_err("nvmet: unhandled cmd %d\n", cmd->common.opcode); pr_err("unhandled cmd %d\n", cmd->common.opcode);
return NVME_SC_INVALID_OPCODE | NVME_SC_DNR; return NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment