From patchwork Mon Oct 5 15:26:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 268159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3B30C4363A for ; Mon, 5 Oct 2020 15:33:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A47B02085B for ; Mon, 5 Oct 2020 15:33:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601911998; bh=otmGQo9aR4iQ9MN62v2ZbUOHYAhYSjVV9JXbojRulVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=FxZ75giL0fibYCYRHaHREw3qXpEf4Bzl50Dol9Tya7RlnhqtSN0IMnBczWnupbRlp MWCLt3OfwOIYbT0NfttWNp8JAOD+SMjeiDn0qC0+CJW/i2PGuiJb8YIk7ZUEJ5g/t8 DN1HOLt5kogstLz0c2g2cHj2jFwX0bwcBZwbeJLQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727349AbgJEPdR (ORCPT ); Mon, 5 Oct 2020 11:33:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:33110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728128AbgJEPdR (ORCPT ); Mon, 5 Oct 2020 11:33:17 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 04E2320637; Mon, 5 Oct 2020 15:33:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601911996; bh=otmGQo9aR4iQ9MN62v2ZbUOHYAhYSjVV9JXbojRulVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i02JEebWdLT+7WOmLa3T0TAMOjV2Hy6bw8OZdyQU3DfCwM6bqZet4VENFfr0z4GRQ mB36WgEW6TbNunOXPfALX94fWDmpZexNy3fxA0GoYIYdWYYsdLAKEVwWXKZeKCWoPq EwWkwZLWqb+wSktzUWVf/lpIO4Ggy7yL0+wObXNE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Wilck , Mike Christie , Sudhakar Panneerselvam , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.8 60/85] scsi: target: Fix lun lookup for TARGET_SCF_LOOKUP_LUN_FROM_TAG case Date: Mon, 5 Oct 2020 17:26:56 +0200 Message-Id: <20201005142117.611099488@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201005142114.732094228@linuxfoundation.org> References: <20201005142114.732094228@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sudhakar Panneerselvam [ Upstream commit 149415586243bd0ea729760fb6dd7b3c50601871 ] transport_lookup_tmr_lun() uses "orig_fe_lun" member of struct se_cmd for the lookup. Hence, update this field directly for the TARGET_SCF_LOOKUP_LUN_FROM_TAG case. Link: https://lore.kernel.org/r/1600300471-26135-1-git-send-email-sudhakar.panneerselvam@oracle.com Fixes: a36840d80027 ("target: Initialize LUN in transport_init_se_cmd()") Reported-by: Martin Wilck Reviewed-by: Mike Christie Signed-off-by: Sudhakar Panneerselvam Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/target/target_core_transport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index e6e1fa68de542..94f4f05b5002c 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1840,7 +1840,8 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, * out unpacked_lun for the original se_cmd. */ if (tm_type == TMR_ABORT_TASK && (flags & TARGET_SCF_LOOKUP_LUN_FROM_TAG)) { - if (!target_lookup_lun_from_tag(se_sess, tag, &unpacked_lun)) + if (!target_lookup_lun_from_tag(se_sess, tag, + &se_cmd->orig_fe_lun)) goto failure; }