From 858d02e5584d2e78a15039e05ccb915b6469d169 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 27 Sep 2013 13:40:58 +0000 Subject: [PATCH] [PATCH] ib_srpt: Always set RSPVALID flag in task management replies The SRP spec requires not only to set the RSPVALID flag and the RSP_CODE field if a task management function failed but also if it succeeded. This patch avoids that the SRP initiator interprets task managment functions that succeeded as failed. Reported-by: Jack Wang git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5002 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 0bc0cf373..ece03885d 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1657,7 +1657,7 @@ static int srpt_build_tskmgmt_rsp(struct srpt_rdma_ch *ch, int resp_data_len; int resp_len; - resp_data_len = (rsp_code == SRP_TSK_MGMT_SUCCESS) ? 0 : 4; + resp_data_len = 4; resp_len = sizeof(*srp_rsp) + resp_data_len; srp_rsp = ioctx->ioctx.buf; @@ -1668,11 +1668,9 @@ static int srpt_build_tskmgmt_rsp(struct srpt_rdma_ch *ch, srp_rsp->req_lim_delta = cpu_to_be32(ioctx->req_lim_delta); srp_rsp->tag = tag; - if (rsp_code != SRP_TSK_MGMT_SUCCESS) { - srp_rsp->flags |= SRP_RSP_FLAG_RSPVALID; - srp_rsp->resp_data_len = cpu_to_be32(resp_data_len); - srp_rsp->data[3] = rsp_code; - } + srp_rsp->flags |= SRP_RSP_FLAG_RSPVALID; + srp_rsp->resp_data_len = cpu_to_be32(resp_data_len); + srp_rsp->data[3] = rsp_code; return resp_len; }