On Thu, 2017-05-04 at 15:50 -0700, Bart Van Assche wrote: > If submitting an SRP IU to the target core fails, send the SCSI > response "BUSY" to the initiator instead of not sending any > response. If submitting a TMF to the target core fails, send > the "FUNCTION REJECTED" response to the initiator. > > Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxxxxxx> > Cc: Doug Ledford <dledford@xxxxxxxxxx> > Cc: Hannes Reinecke <hare@xxxxxxxx> > Cc: Christoph Hellwig <hch@xxxxxx> > Cc: Andy Grover <agrover@xxxxxxxxxx> > Cc: David Disseldorp <ddiss@xxxxxxx> > --- > drivers/infiniband/ulp/srpt/ib_srpt.c | 13 +++++-------- > 1 file changed, 5 insertions(+), 8 deletions(-) > > diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c > index ee026b6b4f0d..317534cd2a64 100644 > --- a/drivers/infiniband/ulp/srpt/ib_srpt.c > +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c > @@ -1376,7 +1376,7 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch, > pr_err("0x%llx: parsing SRP descriptor table failed.\n", > srp_cmd->tag); > } > - goto release_ioctx; > + goto busy; > } > > rc = target_submit_cmd_map_sgls(cmd, ch->sess, srp_cmd->cdb, > @@ -1387,13 +1387,12 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch, > if (rc != 0) { > pr_debug("target_submit_cmd() returned %d for tag %#llx\n", rc, > srp_cmd->tag); > - goto release_ioctx; > + goto busy; > } > return; > > -release_ioctx: > - send_ioctx->state = SRPT_STATE_DONE; > - srpt_release_cmd(cmd); > +busy: > + target_send_busy(cmd); > } > > static int srp_tmr_to_tcm(int fn) > @@ -1450,11 +1449,9 @@ static void srpt_handle_tsk_mgmt(struct srpt_rdma_ch *ch, > TARGET_SCF_ACK_KREF); > if (rc != 0) { > send_ioctx->cmd.se_tmr_req->response = TMR_FUNCTION_REJECTED; > - goto fail; > + cmd->se_tfo->queue_tm_rsp(cmd); > } > return; > -fail: > - transport_send_check_condition_and_sense(cmd, 0, 0); // XXX: > } > > /** Ignoring for now, because it depends upon functionality that doesn't exist as a standalone bug-fix (target_send_busy). -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html