summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2019-01-25 13:34:51 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2019-02-04 21:32:01 -0500
commit40ca8757291ca7a8775498112d320205b2a2e571 (patch)
treef1440b589862242208a77154958c65324b0aa923 /drivers/infiniband/ulp
parentfd1b6687091450b0ca3303c97f45ecd87401c3d7 (diff)
scsi: RDMA/srpt: Fix a credit leak for aborted commands
Make sure that the next time a response is sent to the initiator that the credit it had allocated for the aborted request gets freed. 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: Hannes Reinecke <hare@suse.com> Cc: Christoph Hellwig <hch@lst.de> Fixes: 131e6abc674e ("target: Add TFO->abort_task for aborted task resources release") # v3.15 Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/srpt/ib_srpt.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index d426e01905f9..1a039f16d315 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -2870,8 +2870,19 @@ static void srpt_queue_tm_rsp(struct se_cmd *cmd)
2870 srpt_queue_response(cmd); 2870 srpt_queue_response(cmd);
2871} 2871}
2872 2872
2873/*
2874 * This function is called for aborted commands if no response is sent to the
2875 * initiator. Make sure that the credits freed by aborting a command are
2876 * returned to the initiator the next time a response is sent by incrementing
2877 * ch->req_lim_delta.
2878 */
2873static void srpt_aborted_task(struct se_cmd *cmd) 2879static void srpt_aborted_task(struct se_cmd *cmd)
2874{ 2880{
2881 struct srpt_send_ioctx *ioctx = container_of(cmd,
2882 struct srpt_send_ioctx, cmd);
2883 struct srpt_rdma_ch *ch = ioctx->ch;
2884
2885 atomic_inc(&ch->req_lim_delta);
2875} 2886}
2876 2887
2877static int srpt_queue_status(struct se_cmd *cmd) 2888static int srpt_queue_status(struct se_cmd *cmd)