nvmet-tcp: remove redundant calls to nvmet_tcp_fatal_error()
Subsystems (2)
PATCH 1/1 nvmet-tcp: remove redundant calls to nvmet_tcp_fatal_error()
Executing nvmet_tcp_fatal_error() is generally the responsibility of the caller (nvmet_tcp_try_recv); most other functions should just return the error code, with minor exceptions where direct handling is necessary.
Signed-off-by Maurizio Lombardi <[email protected]>
--- drivers/nvme/target/tcp.c | 9 --------- 1 file changed, 9 deletions(-)
drivers/nvme/target/tcp.c +0 -9
@@ -898,7 +898,6 @@ static int nvmet_tcp_handle_icreq(struct nvmet_tcp_queue *queue)if (le32_to_cpu (icreq->hdr.plen) !=sizeof (struct nvme_tcp_icreq_pdu )) {pr_err ("bad nvme-tcp pdu length (%d)\n" ,le32_to_cpu (icreq->hdr.plen)); -nvmet_tcp_fatal_error (queue);return -EPROTO ; }
@@ -1023,7 +1022,6 @@ static int nvmet_tcp_handle_h2c_data_pdu(struct nvmet_tcp_queue *queue) err_proto:/* FIXME: use proper transport errors */ -nvmet_tcp_fatal_error (queue);return -EPROTO ; }
@@ -1038,7 +1036,6 @@ static int nvmet_tcp_done_recv_pdu(struct nvmet_tcp_queue *queue)if (hdr->type != nvme_tcp_icreq) {pr_err ("unexpected pdu type (%d) before icreq\n" , hdr->type); -nvmet_tcp_fatal_error (queue);return -EPROTO ; }return nvmet_tcp_handle_icreq (queue);
@@ -1047,7 +1044,6 @@ static int nvmet_tcp_done_recv_pdu(struct nvmet_tcp_queue *queue)if (unlikely (hdr->type == nvme_tcp_icreq)) {pr_err ("queue %d: received icreq pdu in state %d\n" , queue->idx, queue->state); -nvmet_tcp_fatal_error (queue);return -EPROTO ; }
@@ -1064,7 +1060,6 @@ static int nvmet_tcp_done_recv_pdu(struct nvmet_tcp_queue *queue)pr_err ("queue %d: out of commands (%d) send_list_len: %d, opcode: %d" , queue->idx, queue->nr_cmds, queue->send_list_len, nvme_cmd->common.opcode); -nvmet_tcp_fatal_error (queue);return -ENOMEM ; }
@@ -1208,7 +1203,6 @@ static int nvmet_tcp_try_recv_pdu(struct nvmet_tcp_queue *queue)if (unlikely (!nvmet_tcp_pdu_valid (hdr->type))) {pr_err ("unexpected pdu type %d\n" , hdr->type); -nvmet_tcp_fatal_error (queue);return -EIO ; }
@@ -1223,13 +1217,11 @@ static int nvmet_tcp_try_recv_pdu(struct nvmet_tcp_queue *queue)if (queue->hdr_digest &&nvmet_tcp_verify_hdgst (queue, &queue->pdu, hdr->hlen)) { -nvmet_tcp_fatal_error (queue);/* fatal */ return -EPROTO ; }if (queue->data_digest &&nvmet_tcp_check_ddgst (queue, &queue->pdu)) { -nvmet_tcp_fatal_error (queue);/* fatal */ return -EPROTO ; }
@@ -1316,7 +1308,6 @@ static int nvmet_tcp_try_recv_ddgst(struct nvmet_tcp_queue *queue) le32_to_cpu(cmd->exp_ddgst));nvmet_req_uninit (&cmd->req);nvmet_tcp_free_cmd_buffers (cmd); -nvmet_tcp_fatal_error (queue); ret = -EPROTO ; goto out; }
Signature · 1 line
2.43.5