From patchwork Wed Oct 19 08:30:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4809 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp217322wrs; Wed, 19 Oct 2022 02:20:25 -0700 (PDT) X-Received: by 2002:a17:907:a42a:b0:78d:3ade:a543 with SMTP id sg42-20020a170907a42a00b0078d3adea543mr6068387ejc.400.1666170985604; Wed, 19 Oct 2022 02:16:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6tMT3c0wbc+B9OsJ45bOo5OJRFQS8km6WuCNEk5naga/s/wgAk7JP1theHBxVsUIqyqNip X-Received: by 2002:a17:907:a42a:b0:78d:3ade:a543 with SMTP id sg42-20020a170907a42a00b0078d3adea543mr6068327ejc.400.1666170984476; Wed, 19 Oct 2022 02:16:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170984; cv=none; d=google.com; s=arc-20160816; b=zNVOqanr0K/Xw+inpch1NI2kc4OTYAxzI0F5PGCbxjSx87tDCoMMJinxIn/Nsu9AI8 +kvgiTe7TZyWizUcoTfZXeLXybBc6Zlildk4hbBHoqG5mwcMWsGUyRkCMEjPigNhXa4q RCevzR1rOwEcDVIgUfcpnjISEm5tchNgKPOXjugXdhMCKd3mO5ijQJr4r5Turw/OxtnP kPuV9t02tC8K5FEgSTwgA9g8AJnQu1BRtS4AQ4FDbOEaRai8pnppwlh6GtCWqA30V09r jWQ3xDOd3bXaioqLg3SqiIqypNYnkvW0PpMeFoD+dRiKYp2//U0XG+kwKHax0pzNgFiB CxuQ== 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=fwrpnl/cufWskTVYzy32pMvoOxItOA/ZmRCJYMefCXU=; b=fIpefYTh2I82q/BIyaqIhwzQ1tbW0BZhh0yS6tTJZEOCOzhiOsjI2YRQRKyma95Uvm zrPEj/H97qqDhOt8so5PZDxhEGSX7/zR1IMbSvVlo6ymdvtqVSvAvSAQLQ+8JOXZ5VX1 1X/6FNbkx2gLqmEf3dLIlzCZV19slZtytCKvCcKzSbQWK1vJqkm7TPP3Ejq8agKXqXgy zXVZQKSI9Z5xvrXmLHw0U2Pn8p69tCx5kqrBN03Bj0DgSGv5TEaOAfRwRuetR2iklxZ3 n5p8A13GP0ZykJdYtG9jNT0y2vCjrqATEyMv/RwkiwWBMBLKrWvEGQHxXF66XZoOflj7 Kzaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LUwY8y1r; 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 qf24-20020a1709077f1800b0078a4aad3141si15863866ejc.211.2022.10.19.02.15.59; Wed, 19 Oct 2022 02:16:24 -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=LUwY8y1r; 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 S233033AbiJSJN2 (ORCPT + 99 others); Wed, 19 Oct 2022 05:13:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232620AbiJSJK4 (ORCPT ); Wed, 19 Oct 2022 05:10:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 081B9C3564; Wed, 19 Oct 2022 02:02:32 -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 2C85C61830; Wed, 19 Oct 2022 09:02:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3744CC433C1; Wed, 19 Oct 2022 09:02:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170122; bh=Ggo1VEe0EXDgrsvE/t2ids5mCaXNBVenLwbwOjRvDNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LUwY8y1rvtyLxQJ+Rzxyv0vLBVPcJPkX2oYoNzFb5qAiS0Kjm/fr8H4h4nT9EQld4 ZoB/K/dXUY6voucGo0U5Nn7++b0tzaIjLFAKOyOXXY5EpzFEYMm1pojRBDvhCCkSt8 ocm9cBfcMpd0tTevU2fTeUYNKClPBbSLFH2Ud0K8= 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 6.0 536/862] RDMA/srp: Fix srp_abort() Date: Wed, 19 Oct 2022 10:30:23 +0200 Message-Id: <20221019083313.638697595@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747106906332977422?= X-GMAIL-MSGID: =?utf-8?q?1747106906332977422?= 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 d7f69e593a63..9c9872868aee 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -2789,7 +2789,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; @@ -2797,8 +2797,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))