Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2537240yba; Mon, 6 May 2019 07:40:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmFyxt4bUBh2IxwwbnuXzlJf9lDWox8YSzHgtMr+kdyXb7e3CQNSycvZAGHAfk1RFpLe1R X-Received: by 2002:a65:610a:: with SMTP id z10mr32508656pgu.54.1557153630761; Mon, 06 May 2019 07:40:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557153630; cv=none; d=google.com; s=arc-20160816; b=ne1L4u782sHtLX744kP4YY3YWP457pdn9aEgKiA2TC8jZF5guqf00wP7wV3w+nnCoU JWOwFYfbYxp5LdD8sCis2ypchHTRvrw0a92CClK41FNzvwAU5X+4Txhu9kXyaFS2aSno 3pRt86Rb4m9Hbl2XfvQ0uJslOzPBCYAyf4YR156pBWq0PUdK9O6+PMAFtxkT/xmU11eW /VIp+pTSENm0hF35akZX6l/vo226DWrZxzVyQMHCMiDKzJY/3GXAFQjgo+XCBRSjM8mr 1i4I1FhMe4loEu5ewED95IAxW/3m8Z25NlsWqN/Y9VZJzCF/lGmZddsufhBOQUyA6ZBK 2nLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ulBJzpqGJH5neQdef5SxxKTbSl+6DzXW7b0JXNfplqI=; b=WX+SExP+5iptUs3Osz0swZT/SsWDbdvzz4cZXSyqBd8D1UrCPNzpE8zmBM8EySCX2D VNs/HPGsX8wqIAqlcmWVDn44VFLaB2h/auUpPcBYolaTY7IzutIg7tyYyJuGrz2KzXzT TpXMYPEUUbGIrFGfa6d8dL5Ag6xbcdkZvOa5CJYq/zTjJ4WL7gTq3Xz3YL+KSYewdLdg zC8vpzuG/b7uBXbBcaG7fdJUx3HM2haj0qIIIDPKeLVII5zF8YFuip142x0PbpqLpnL8 7Cw/INd5NHY4hYbAI0cgiHPda+L6XuwkRb9olpwOqFdhYBXfmeUNz/631NUX76ylc/Yx T3Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fr1FjVKl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b67si16470669plb.206.2019.05.06.07.40.14; Mon, 06 May 2019 07:40:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fr1FjVKl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727410AbfEFOhb (ORCPT + 99 others); Mon, 6 May 2019 10:37:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:58164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727395AbfEFOh2 (ORCPT ); Mon, 6 May 2019 10:37:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4490320449; Mon, 6 May 2019 14:37:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153447; bh=GUiVy+722ByJzV1vIVKdMdL5x+aWBD1kEf1es+X2vUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fr1FjVKlmt36gqaPndBc7bSzIEf7OVYKrae4EGA7qzXmuXBZYOqz40F7UELwZ2l4M Tc58wiEZT+wz1DSXeoI1S8m9kq1o+XCH/GeQ6FnjOXtbDfQx3JlHWrGAk92Bc8MR/d +YmyoHef0hfkH9sT+zo8473lX6iDxhwawEfzWGCA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Doug Ledford , Jason Gunthorpe , Nicholas Bellinger , Mike Christie , Hannes Reinecke , Christoph Hellwig , Bart Van Assche , "Martin K. Petersen" Subject: [PATCH 5.0 093/122] scsi: RDMA/srpt: Fix a credit leak for aborted commands Date: Mon, 6 May 2019 16:32:31 +0200 Message-Id: <20190506143103.030056875@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143054.670334917@linuxfoundation.org> References: <20190506143054.670334917@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bart Van Assche 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 Cc: Jason Gunthorpe Cc: Nicholas Bellinger Cc: Mike Christie Cc: Hannes Reinecke Cc: Christoph Hellwig Fixes: 131e6abc674e ("target: Add TFO->abort_task for aborted task resources release") # v3.15 Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/ulp/srpt/ib_srpt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -2887,8 +2887,19 @@ static void srpt_queue_tm_rsp(struct se_ 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)