From patchwork Sat Oct 22 07:25:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7511 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1105003wrr; Sat, 22 Oct 2022 01:33:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4OPINSxuqOj5QN1c3onv6OvFFX+4/8AMNc5NKjpERZN1Tkg5mXpOK1Q26qyDTAzDI2OQMZ X-Received: by 2002:a05:6402:5510:b0:459:5ea:9bc0 with SMTP id fi16-20020a056402551000b0045905ea9bc0mr20874641edb.152.1666427633376; Sat, 22 Oct 2022 01:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427633; cv=none; d=google.com; s=arc-20160816; b=q3QVUcj30IXM5MSYMkm+qu5/RvIkYYikNXh9sjvFHpTqWUNG4nN301wRAHgijdVpTm e3rJ+oI/KGD+qkcf4ap/yqN6rV5y6SEGl0ut9GHo2sChXmOaCBhyUFqYjUUM3+ah+2f7 4hO2o5/ONWteCm/06+DfCv0xTKaGWP4cSEIKCbjBeUHRTiaDXucOq9ryL62yt2T/pbmq QnRHazAFdUnJhnt6AfFWpJ9Ks9Jp78FlCl9FrAik3uGitf7MtB/f7iRhCx5DgV4QZLcY zSu/yPEQrwu25NdK2MC2zFOW3WP9Cd/Yux0s251m2dRp1L+ehlDWIti0330/sQ0Gi7AO 4Kvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=x/C8ngJOJXA2TllicwwHUY+axUQoFEe2+vpUnLTk3Fg=; b=y794mrFE/z788iZsulaxCU8Sn07H21HJsUBuTshO6WQomN+os2Sy/fBkAEs21u3qvU /iShFp/968I5UvGROp79VW+WmcbBR7go5KPPFVBOQ78PT2tNQJ91e6sMA79UC+HRLO3T Bsn0eMxXz3JgXvDP3aQ2njP7uL5iEmb3HWc63ypP+SgkBrKhibpGeVepmzM7hGbOvI7+ 6sYvlKmLvUy/YsF/n6uFeq3cLi0gA/H3eILDZe4Z3JUAV8TYLB6AMozZ+cCDSs5HmZHr hQqKu/JGZpRfsMGZqvyafgc+qJ7tGEFz2n7nWePtd476DDvfMA5WGy0ihit/KWMXF2Ng XsvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qlYtqOTx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho6-20020a1709070e8600b0078d484e0e79si25783722ejc.481.2022.10.22.01.33.24; Sat, 22 Oct 2022 01:33:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qlYtqOTx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233610AbiJVISy (ORCPT + 99 others); Sat, 22 Oct 2022 04:18:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234113AbiJVIQQ (ORCPT ); Sat, 22 Oct 2022 04:16:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E59662CCA14; Sat, 22 Oct 2022 00:57:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 880B660B09; Sat, 22 Oct 2022 07:55:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75970C433D7; Sat, 22 Oct 2022 07:55:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425317; bh=DTxLj2qZk1GdpPUnu3tsMQyL5o4/02omjiqHhRkiaNU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qlYtqOTxEd3MiE3SCOhHAqjLscaoiQP6U2dkNklQ1NjKToCjqfQ1NcYkGL0TOfHZO Udqkq8gblDaX912hdGJBF8XQSLre++fnCKjU49ZUV3eAQKCtAbqeNYVBDBlJXXoEFd MRjM6TqNb0KtDxDt+os9slNe8AbPACP3bh5GGa7o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiao Yang , Bart Van Assche , Leon Romanovsky , Sasha Levin Subject: [PATCH 5.19 431/717] RDMA/srp: Fix srp_abort() Date: Sat, 22 Oct 2022 09:25:10 +0200 Message-Id: <20221022072517.488627490@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376022324570844?= X-GMAIL-MSGID: =?utf-8?q?1747376022324570844?= From: Bart Van Assche [ Upstream commit 6dbe4a8dead84de474483910b02ec9e6a10fc1a9 ] Fix the code for converting a SCSI command pointer into an SRP request pointer. Cc: Xiao Yang Fixes: ad215aaea4f9 ("RDMA/srp: Make struct scsi_cmnd and struct srp_request adjacent") Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20220908233139.3042628-1-bvanassche@acm.org Signed-off-by: Leon Romanovsky Signed-off-by: Sasha Levin --- drivers/infiniband/ulp/srp/ib_srp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 3d9c108d73ad..c3fa65977b3e 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -2790,7 +2790,7 @@ static int srp_send_tsk_mgmt(struct srp_rdma_ch *ch, u64 req_tag, u64 lun, static int srp_abort(struct scsi_cmnd *scmnd) { struct srp_target_port *target = host_to_target(scmnd->device->host); - struct srp_request *req = (struct srp_request *) scmnd->host_scribble; + struct srp_request *req = scsi_cmd_priv(scmnd); u32 tag; u16 ch_idx; struct srp_rdma_ch *ch; @@ -2798,8 +2798,6 @@ static int srp_abort(struct scsi_cmnd *scmnd) shost_printk(KERN_ERR, target->scsi_host, "SRP abort called\n"); - if (!req) - return SUCCESS; tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmnd)); ch_idx = blk_mq_unique_tag_to_hwq(tag); if (WARN_ON_ONCE(ch_idx >= target->ch_count))