Commit 8b8807b9 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: RDMA/srpt: Fix handling of command / TMF submission failure

If submitting an SRP IU to the target core fails, send the SCSI response
"BUSY" to the initiator instead of not sending any response.
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Mike Christie <mchristi@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 94ebb471
...@@ -1505,7 +1505,7 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch, ...@@ -1505,7 +1505,7 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch,
pr_err("0x%llx: parsing SRP descriptor table failed.\n", pr_err("0x%llx: parsing SRP descriptor table failed.\n",
srp_cmd->tag); srp_cmd->tag);
} }
goto release_ioctx; goto busy;
} }
rc = target_submit_cmd_map_sgls(cmd, ch->sess, srp_cmd->cdb, rc = target_submit_cmd_map_sgls(cmd, ch->sess, srp_cmd->cdb,
...@@ -1516,13 +1516,12 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch, ...@@ -1516,13 +1516,12 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch,
if (rc != 0) { if (rc != 0) {
pr_debug("target_submit_cmd() returned %d for tag %#llx\n", rc, pr_debug("target_submit_cmd() returned %d for tag %#llx\n", rc,
srp_cmd->tag); srp_cmd->tag);
goto release_ioctx; goto busy;
} }
return; return;
release_ioctx: busy:
send_ioctx->state = SRPT_STATE_DONE; target_send_busy(cmd);
srpt_release_cmd(cmd);
} }
static int srp_tmr_to_tcm(int fn) static int srp_tmr_to_tcm(int fn)
......
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