From patchwork Sun Apr 23 14:13:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Gurtovoy X-Patchwork-Id: 13221362 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 428FDC6FD18 for ; Sun, 23 Apr 2023 14:14:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230300AbjDWOOp (ORCPT ); Sun, 23 Apr 2023 10:14:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230305AbjDWOOl (ORCPT ); Sun, 23 Apr 2023 10:14:41 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on20616.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8d::616]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDFDE3588 for ; Sun, 23 Apr 2023 07:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IqRhgCj1besjdNz9ObyDPhUV63pNzl9IEKPhccP1XLzr3uOeJbURCQUG7B2DyqlQyRtsp7X33Sju+DlqWTsLS90RKHPcHV/xfuMPOu1NjijWsCInTS041kBd5CHIrxu43C/096V2M5KMdjjZuG7iyIuKSrPMharMIarNKxGVjZo8i3pLQ+7fGDNTNOtjl8GZSLoRQhFQMHDyV/S4x4Z9DMc3PC44xqaYNUwy1SA6NeXElSJJTXl9Cq4VaVNHgxIUMMBB/R07Gb9U9YYyVYSR8Sgyx8B7bYRpPlTu84k1lsf1sNAQEjyOYoKanKnPIdlMN6htTJpKa+DVk2HMy2pcxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=D8nmwQsNxBCNLUdxpQo0CuuUF6jcsFhD6ki8Bq/5KUg=; b=NlsZHWNuLG5ntoZCMG8rX8QPxOMkcGVeg4TD+OQYQZZFwatZm+AYaVmp/0xQP0RyCWVrxgI/bjHunepfYDFr9XO7yxbXrEbJxSY8rM3x4tv8nMSNbD337QnAAfb2lavpKrYOmU7eGPzNKjMJ1XQiccDLVxtoI0tZZ/0CREqFevUVk/2KWQ7oy4EaIaFK4ED7nFvk3SUEvyiTJlIRERRUBKNEROBBdoIfFv7fOgo/rcLhVbwY+BDVe1Ut34uRnjrpHb3EiQO3EdzDGOnEm14sQA6zYAapIMthmvwHWSn9qHOnnN/nqWkibMGbbTqw4pVjhZJKyUk1iyMTw+obS4b7gw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=oracle.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D8nmwQsNxBCNLUdxpQo0CuuUF6jcsFhD6ki8Bq/5KUg=; b=oho4sckpAU8Q0Qg+Pqemjs6TmftusGo0915kY+zHwTpUn5j229QlP6vmZag8FV8VIhFJD0cTsROob6gEyWcGbTu87/yssB7ER6ipvT1hmHvcoEavuahFbwhZF0rSDvjfJ7tHsd80afK0aRXwGAK/CX7alsEUbcieZ0kDm/xyOWFW6N/p+ys+xahuMjRKrN3OY5MfjCl5Iq7ZevJ0Lr81TQt1D5UhKiLsVKeH5VJSu5lMajY+MqWg8Awsx1DHyCwJ1Mrjte+jI/c9220bAGVrdaeGYKWVGYwZn/nRioeRfZNv6acEk+EQNR1zo1/d6JPopuEgV6r+cqLERSwVAXF0Rw== Received: from DS7PR06CA0047.namprd06.prod.outlook.com (2603:10b6:8:54::27) by PH7PR12MB6419.namprd12.prod.outlook.com (2603:10b6:510:1fd::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.32; Sun, 23 Apr 2023 14:13:38 +0000 Received: from DM6NAM11FT115.eop-nam11.prod.protection.outlook.com (2603:10b6:8:54:cafe::14) by DS7PR06CA0047.outlook.office365.com (2603:10b6:8:54::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.32 via Frontend Transport; Sun, 23 Apr 2023 14:13:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT115.mail.protection.outlook.com (10.13.173.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.18 via Frontend Transport; Sun, 23 Apr 2023 14:13:38 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sun, 23 Apr 2023 07:13:37 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sun, 23 Apr 2023 07:13:36 -0700 Received: from r-arch-stor03.mtr.labs.mlnx (10.127.8.14) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Sun, 23 Apr 2023 07:13:34 -0700 From: Max Gurtovoy To: , , , CC: , , , , , , Max Gurtovoy Subject: [PATCH v1 1/2] block: bio-integrity: export bio_integrity_free func Date: Sun, 23 Apr 2023 17:13:29 +0300 Message-ID: <20230423141330.40437-2-mgurtovoy@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230423141330.40437-1-mgurtovoy@nvidia.com> References: <20230423141330.40437-1-mgurtovoy@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT115:EE_|PH7PR12MB6419:EE_ X-MS-Office365-Filtering-Correlation-Id: b4204af7-9bf4-48bf-f161-08db4404eefa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Zf8OLDweHYSbtIi5E1VH1Yt4SoQr4rc3ZzRDtcRR7zHAaEzva4muGlR+FoEHogYyba1m6ClNKowXsgu9N4ULrgD4naq4fadeE6Ob4PhGtoomYzCQrX3ZSBSFf/DL0Yl9LxMsy3r3z1OR7rFaP+/nWVw+1tC2e8xqRy9heiOsiTwnlaoNYUYAJUvhy5KenuKPvRlSPOOwCU2LLzW/W+Lf4KcUzHOHb9ID6LaEeJpuoq6k0gVGSb3gkPFQrkLtADVwtfA8G2eZvUHrEcOEP4wbtIPK1m3mS+lcSam6Ym/c3mgRQUjzQYKcBGTwcBKM1LmzBuIuFvUGLJCV6C88lgMFFifj1svPnmX47w4A7WJ5oDRscinqoxA1K55HfYDGDf9R9fH36qjv9JuhHDjyMBX5nWnplKUIjHyk1O/ikdEOuRAhYJUfg77Xd3WSj+uA9Hx3oxRTIs+pnEqUJ2cw0dzx9t8/gRnHFtvJjgDMNv3+8wOuBO3ZW03MV6KwyS4HqCrdqEvxSikNxkDUd8RBnd7ohcOY3OLHD70+GGehXcKMFK9yUvTOrIfKeXa/gUhVmbYBcZnsDJXdx2Gg/QI0fgjeynwrK5N/KKPJGxd92hTAqWZDwmhRSN7knpsfsvnh4H1TGK4DVEV72WeqyjUN7z88sbvLo8XemWXQeDWlBl9SWupGQFwTwKZfBELa0lhISa6BwxGl5DtdAoPWOXKZ/i7r8BrVxZ9hxoH+vw06gsDthkU= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(39860400002)(346002)(376002)(451199021)(46966006)(40470700004)(36840700001)(107886003)(1076003)(26005)(8676002)(8936002)(4326008)(70206006)(70586007)(54906003)(316002)(36756003)(110136005)(41300700001)(478600001)(40460700003)(6666004)(5660300002)(40480700001)(36860700001)(47076005)(7636003)(356005)(82740400003)(34020700004)(86362001)(2906002)(2616005)(186003)(83380400001)(82310400005)(336012)(426003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2023 14:13:38.1632 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b4204af7-9bf4-48bf-f161-08db4404eefa X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT115.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6419 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org This function is the complementary function to bio_integrity_alloc. Export it for users that would like to free the integrity context explicitly. Signed-off-by: Max Gurtovoy --- block/bio-integrity.c | 1 + include/linux/bio.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 4533eb491661..276ca86fc1d3 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -110,6 +110,7 @@ void bio_integrity_free(struct bio *bio) bio->bi_integrity = NULL; bio->bi_opf &= ~REQ_INTEGRITY; } +EXPORT_SYMBOL(bio_integrity_free); /** * bio_integrity_add_page - Attach integrity metadata diff --git a/include/linux/bio.h b/include/linux/bio.h index d766be7152e1..3888a609b4bb 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -700,6 +700,7 @@ static inline bool bioset_initialized(struct bio_set *bs) bip_for_each_vec(_bvl, _bio->bi_integrity, _iter) extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); +extern void bio_integrity_free(struct bio *); extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int); extern bool bio_integrity_prep(struct bio *); extern void bio_integrity_advance(struct bio *, unsigned int); @@ -764,6 +765,10 @@ static inline void *bio_integrity_alloc(struct bio * bio, gfp_t gfp, return ERR_PTR(-EINVAL); } +void bio_integrity_free(struct bio *bio) +{ +} + static inline int bio_integrity_add_page(struct bio *bio, struct page *page, unsigned int len, unsigned int offset) { From patchwork Sun Apr 23 14:13:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Gurtovoy X-Patchwork-Id: 13221363 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9347BC6FD18 for ; Sun, 23 Apr 2023 14:14:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230295AbjDWOOr (ORCPT ); Sun, 23 Apr 2023 10:14:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230312AbjDWOOm (ORCPT ); Sun, 23 Apr 2023 10:14:42 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::601]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04235211D for ; Sun, 23 Apr 2023 07:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zx1uy3OWUZpTf4yppV0cACdLe961XU5qLZG1f3yDUlMsSCaLAaQHypkjRCZO19V6r26NZaM9ZzV2IiwyrQLaq6mUWIQORlDnZiebbEEwoxyFsn+YXMyWr3pTmhGqnkP+Ce7opP1SAMHVzmmn+ZutTVmUElcn6yNPytjh/AQ3YL+dUufRDvTdmLQZKlxJFvICJ54RNqf0HtSopiO2pHcfGYfFfXhBWhvx0ZEvkcVqrErheZld7YV+RRLUH0EMnDJxq5izLLKRwzBxeimgWVseWxu4AQ2JZXKkDr6jWpwvq5JU6EThJSWRPyRVnrR1/q0TybVwd4RkzpVuUaoy5ycu1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TBzr2wsHFDY5MRNjiXZr517dh+qC2IlhgyJeFWBYqtw=; b=PLlOf7s2eH6DkMirkGUto4T6mKO+oKpuQ7Au2hSH4x7RDwjb9AlE0ut+KnIaO2+gmUhEjRhpvnECjtqhNGxTRe3OZ9xHM86S1lCIQ/NRA0pbtJEWr+WKQbpna8mL8B0wVUu4pzaYbQpt1c+GpYzGNHLTg19ospm4AZeVNBsti+J9JIDjQ3qtWYXHWFDNBR/kkotbG3TvjdMqGTUkFPqV3IVdr5vG3P1IfJ1pFO5ZtZ0mN15AQJjx5iEDTOvTTJECXU5zQb+4HYK+QKG4kaua3MRahwdUwX0rxe+FpESol9tlTeh1mhWoy4O4aWlWGE37m85ifECrR4uvURvzTzSiCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=oracle.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TBzr2wsHFDY5MRNjiXZr517dh+qC2IlhgyJeFWBYqtw=; b=pIHI99CY3Ll+IZ83FM3mzRuXV6t2HWdBCCsE6y1mLYGF7Eendlj+nXGFuA/nfqApiIEqaPLLYzmbymAt2lMChtEbln1/5nQ47E+QehsUfFZ36Ca9Rp+4fUNY0pgbqSy8xWYV5NHDlWOmkE5qs5Zpr+x3XqbiXtb1v2qG4ul058uP+osLe2iKj90chUM+ePmPTqP8PGXAs+yOgPtcL9WD4phBfZvEhNBomrC9t9G8BRfHeb1uP23Wi1jUQGqX2RGXx07SwsZ1LLknAcl3yfG5DyN7oDOzJagYj9Xq9Sc475JSjeiyaADlrkyVRvQmTEkG9NHgbf+UWXyhjpahUK0WTA== Received: from DS7PR05CA0053.namprd05.prod.outlook.com (2603:10b6:8:2f::34) by SA1PR12MB8141.namprd12.prod.outlook.com (2603:10b6:806:339::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Sun, 23 Apr 2023 14:13:43 +0000 Received: from DM6NAM11FT103.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2f:cafe::6a) by DS7PR05CA0053.outlook.office365.com (2603:10b6:8:2f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.19 via Frontend Transport; Sun, 23 Apr 2023 14:13:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT103.mail.protection.outlook.com (10.13.172.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.19 via Frontend Transport; Sun, 23 Apr 2023 14:13:42 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sun, 23 Apr 2023 07:13:40 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sun, 23 Apr 2023 07:13:39 -0700 Received: from r-arch-stor03.mtr.labs.mlnx (10.127.8.14) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Sun, 23 Apr 2023 07:13:37 -0700 From: Max Gurtovoy To: , , , CC: , , , , , , Max Gurtovoy Subject: [PATCH v1 2/2] nvme-multipath: fix path failover for integrity ns Date: Sun, 23 Apr 2023 17:13:30 +0300 Message-ID: <20230423141330.40437-3-mgurtovoy@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230423141330.40437-1-mgurtovoy@nvidia.com> References: <20230423141330.40437-1-mgurtovoy@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT103:EE_|SA1PR12MB8141:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b78630a-e23e-4f18-ca06-08db4404f1c4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h2bxQCZMxYEEIjecJt5su/egkaExJt9gajVed96ckmS5FlrNrtyjNql4mbSXDKdStL/hj45ykdpM8Vavgwk7ZYysE1vpS/5X2vfDjgyms9r7/hMi8tt51SHc4YSl/JrJjnvWPVgvMLQ9AJC0shanrlZIU2d/HnbS9XDOZOOmbqI2bfOffCmieTF7iXuWz2JQJ/A1MtxuIT82Ket+XH6od2C5P3eltCM1mZF184dKzZHH+EXjra0+CV59GdMoqgBxdpOY8Ir6LI78w3SdSkQrulV8DRg9V65t82K4u/XRBjhV6XpQ/jiP814yqkBoZoWmu0n4PU1HV+Cdm/6kriR0kQ6y2JOqAIta+BmoaHc+w4XaDeGpqVh+6NuYVfAzppOSIMSB+jcFCLOxp3HLMvimnM+fnKOwcSJWc0/Margj7n3nWyeoqWzmnGF7tKY3dldh/qKL9E2wse/2wQ6FJ7PjrLHxexeNC0V8yu09yW7UBhYeVIlHeJWP15wIlPZL8p06a12H5fI74DH5n7fYGngpsqRaF61JBYFJXqobiEyDB5T8sDqfiRGGlR0U5/wf7i6xAWMoERunpuB55PHjTnNmik/Rud4iynSMu5mEFZVuxNyAW6zt8cTVpJp3IvlwzfGwPv8dPNRh2nzDi9o9kkklU5YcrsLWQ0ttBbh/AJlFwB5BQvQI6BwIhDK1+aGRHpfN7az0ZRNsLa8a+SyHhbspnzYfVoGm712F9fLSRXtho1E= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(346002)(39860400002)(376002)(451199021)(40470700004)(46966006)(36840700001)(34020700004)(36756003)(54906003)(83380400001)(478600001)(2616005)(36860700001)(47076005)(40480700001)(1076003)(107886003)(26005)(6666004)(316002)(110136005)(4326008)(186003)(336012)(426003)(82740400003)(70206006)(70586007)(5660300002)(8936002)(2906002)(8676002)(356005)(40460700003)(7636003)(41300700001)(86362001)(82310400005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2023 14:13:42.8414 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4b78630a-e23e-4f18-ca06-08db4404f1c4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT103.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8141 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org In case the integrity capabilities of the failed path and the failover path don't match, we may run into NULL dereference. Free the integrity context during the path failover and let the block layer prepare it again if needed during bio_submit. Reviewed-by: Israel Rukshin Tested-by: Ori Evron Signed-off-by: Ori Evron Signed-off-by: Max Gurtovoy Reviewed-by: Sagi Grimberg --- drivers/nvme/host/multipath.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 9171452e2f6d..f439916f4447 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "nvme.h" @@ -106,6 +107,14 @@ void nvme_failover_req(struct request *req) bio->bi_opf &= ~REQ_POLLED; bio->bi_cookie = BLK_QC_T_NONE; } + /* + * If the failover path will not be integrity capable the bio + * should not have integrity context. + * If the failover path will be integrity capable the bio will + * be prepared for integrity again. + */ + if (bio_integrity(bio)) + bio_integrity_free(bio); } blk_steal_bios(&ns->head->requeue_list, req); spin_unlock_irqrestore(&ns->head->requeue_lock, flags);