diff options
| author | Bart Van Assche <bvanassche@acm.org> | 2019-01-25 10:34:51 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-08 07:21:52 +0200 |
| commit | 9d696f405e6d86539bf96e3eb67c1e4c98919f54 (patch) | |
| tree | 68791ce38b2d8ba529a1bcc61cd0fba4edb6c068 /drivers/infiniband/ulp | |
| parent | f16e83170e252f5406e8974c885dbd96329ea381 (diff) | |
| download | linux-9d696f405e6d86539bf96e3eb67c1e4c98919f54.tar.gz linux-9d696f405e6d86539bf96e3eb67c1e4c98919f54.tar.bz2 linux-9d696f405e6d86539bf96e3eb67c1e4c98919f54.zip | |
scsi: RDMA/srpt: Fix a credit leak for aborted commands
commit 40ca8757291ca7a8775498112d320205b2a2e571 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/infiniband/ulp')
| -rw-r--r-- | drivers/infiniband/ulp/srpt/ib_srpt.c | 11 |
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 f4bce5aa0ff8..ea4afdeb06a4 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -2793,8 +2793,19 @@ static void srpt_queue_tm_rsp(struct se_cmd *cmd) srpt_queue_response(cmd); } +/* + * This function is called for aborted commands if no response is sent to the + * initiator. Make sure that the credits freed by aborting a command are + * returned to the initiator the next time a response is sent by incrementing + * ch->req_lim_delta. + */ static void srpt_aborted_task(struct se_cmd *cmd) { + struct srpt_send_ioctx *ioctx = container_of(cmd, + struct srpt_send_ioctx, cmd); + struct srpt_rdma_ch *ch = ioctx->ch; + + atomic_inc(&ch->req_lim_delta); } static int srpt_queue_status(struct se_cmd *cmd) |
