Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp19835lqo; Wed, 15 May 2024 19:12:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU5ZQ9yauI4WE+C4c8iitpcAV5O7n71f4C61lO01fA0qYtYOED4mGNbfUZg4jMCA7zzpjS7cFvKtkQS8pjTG12yLRh1f+Quz8CanREZ4A== X-Google-Smtp-Source: AGHT+IGXxNz/PjNKsIXb9t1k7nnuvxMPf2JAQE01oYUKE9NSpd+JfYrlBvKaOOLLDd1rlfzASi1s X-Received: by 2002:a9d:7b45:0:b0:6ef:9d2b:2be1 with SMTP id 46e09a7af769-6f0e90f48d6mr21137457a34.3.1715825562665; Wed, 15 May 2024 19:12:42 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63412a4d6cfsi14740035a12.687.2024.05.15.19.12.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 19:12:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180563-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=a2PcGGnc; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-180563-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180563-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EBA55283819 for ; Thu, 16 May 2024 02:12:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CBEB1C32; Thu, 16 May 2024 02:12:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="a2PcGGnc" Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2055.outbound.protection.outlook.com [40.107.255.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D0D61366 for ; Thu, 16 May 2024 02:12:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.55 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715825554; cv=fail; b=P7RQGlqlWRnqklzoBgFuBHsizAd6Qv9abZz/lk80XnGDogmLQAT7VsmsLAUZLnVcvGLdCmqbbbH+eOntp5fNGWpzsmPDIXIqvuUGVXcrkNgmCGkz3jNrfttI3nLiZ6H3MuB2bAAcS0wmX+QsBYn5DgsNm31dsILYptaF7JJpBJw= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715825554; c=relaxed/simple; bh=HRBU9hwcF0B7XIAG9a34mK4X7oov3Pl1/J5aiWmkQ1I=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=P31WrLNoBM7/EIZPQcBoNAh36fbP5msLaLgX6BANwXduYkjdQuulpQqgfhZf+Uo1I18nB0sSwdbedCNd4foe8H82++KPwsu9GVY8xZ/lD7fAV+gyfE9fKvIAAXyihinp+xZSxaV7Z0YY55mIoGZ81ds6n7b9Bf8JJ1czLFyr1VU= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com; spf=pass smtp.mailfrom=vivo.com; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b=a2PcGGnc; arc=fail smtp.client-ip=40.107.255.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i1vFUvB//HI8VSmrHj7swF0DkXwCKWU+LUwm10mYOw5cq8jo1On1iPMFJP23URFczsD5VXCGwPPP5MyU2ZQmIyshhHiD0l+flUxXqiUKu7HIUmxzhx3ieiujKtvgoTwzXdtx5mq6kswUQEXAMVf5rYSmo1BguubuomHdAh4LPyguX8fxxrxVNieYEcq3SAh/z2kVaQ28po1xsbV6JKUWIQl8UxsMKT5SVRNGlxSCTDvivH1gY1dP1Engnyno/wlMBv3tkioBjq0Lml8VH2AxUYodCfJFeirsODy06vOvvjsm9X8vhU6zxGz2xcJ6kz81a1DtNUVPaUIvNgBPV6vbUQ== 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=RDncA7JL+fHBgPPreoZiU/9mKgwsLEruoJ00xhctmFI=; b=kgAlPURzPxG3YWpepEUmg37ccAByxGW6RwS7Z2EZLeRIhp/OPLyaLdcIJMKDG50l5Pme8Dvt4mmQISCEutqzGbBeHYSNsfmkijEYBDho5INaZHCTuJV4Gn6A6OeioB7lYiKvCEZUUpKVedMvoueUAqEegSRD/vEd6W3fAN5/P96qfDjfEp57JE8ulett0fF5/qZnDyML2JsQrRZdDAs4WcXfbnFsrvo2jcuvwn6vhwrTOWFjKxlMJwNdWqByCMK2E9qCq/2xNXuFjXB+4FJqMI7mTdxquf4T0nxzYLt6RRSl2hoQgvN9hOAQmkhXC3le6Z+w/dbEJc6fakEfVaDuIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RDncA7JL+fHBgPPreoZiU/9mKgwsLEruoJ00xhctmFI=; b=a2PcGGncGnJ/naPjbG/hP+CvMEV2et7IsSR3hR/xHJeG0nW7B7JYhGT6C6gKe6ZhB7hXeSj9RSQEZ/UFtyv5puTahQX4yPyLZTJeBQX3LKUQMaGCGlo3KMMPkUykpR1wB4rkFfN16RsyWAgHCtT7YxZvOj2r317BQbEqdgeFI1bIFFT3Ng69cFpWVtnj+6RYUXVIjdTOWXUyzD7ddeh6FQYU18JuuoQzb3Gau4USkaxFdRfzj4aPc5K6iyMR5WPI+NcmaDLY14OC9J4Ix3GnZsQ1kfY0nGSdwfTVs6RiGH7gcRKp1l1SN1jlSlOCnFiM2pEtSvjjjwnboWm5sM8LGQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYSPR06MB6411.apcprd06.prod.outlook.com (2603:1096:400:42a::11) by PUZPR06MB6128.apcprd06.prod.outlook.com (2603:1096:301:116::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.26; Thu, 16 May 2024 02:12:29 +0000 Received: from TYSPR06MB6411.apcprd06.prod.outlook.com ([fe80::8e76:5af3:e027:ccee]) by TYSPR06MB6411.apcprd06.prod.outlook.com ([fe80::8e76:5af3:e027:ccee%3]) with mapi id 15.20.7587.025; Thu, 16 May 2024 02:12:29 +0000 Message-ID: <4971046c-213b-494b-bf4b-ebe3feaa03c1@vivo.com> Date: Thu, 16 May 2024 10:12:25 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/5] dm: support retrieving struct dm_target from struct dm_dev Content-Language: en-US To: Benjamin Marzinski Cc: Alasdair Kergon , Mike Snitzer , Mikulas Patocka , dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org References: <20240514090445.2847-1-yang.yang@vivo.com> <20240514090445.2847-4-yang.yang@vivo.com> From: YangYang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SG2PR01CA0163.apcprd01.prod.exchangelabs.com (2603:1096:4:28::19) To TYSPR06MB6411.apcprd06.prod.outlook.com (2603:1096:400:42a::11) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6411:EE_|PUZPR06MB6128:EE_ X-MS-Office365-Filtering-Correlation-Id: 238e4c2d-bc8b-415b-724f-08dc754da362 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ejFaSGVHeTduUEg0a01kaW94R1hnK3EzNGF6VkxEQ2J6cW9SVkVxMnM3Ri9V?= =?utf-8?B?c2ZDb2QzTUpUNWc3QnBzT0c1dUlGWVhobHVUWEpRT0Z5Nkw4b1g0bmUwVkVZ?= =?utf-8?B?TGhhVkdSSnFOeE5oV3FGSHRoUW9ya1NEQTJmRndCTFZDQU0yS3JVYnIvaHUz?= =?utf-8?B?amVOd3NCUDBIWVg2a0xUZmRtRnRvcm9yRzZRR3NIM0VwUit0T0ZRTVczcXRo?= =?utf-8?B?MXlvV1dvRnNpaWEvSmRQT0NWM2JieUlqNWhyU0J0Z1JzdnkvUXNuaEJXMGZq?= =?utf-8?B?ekJUL2Y2S0cvMFIySGhD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25MdkpHdWlOUmR2RjRFY20vQTZYU1QvQWNQZGdhazlCTE5DYitj?= =?utf-8?B?c2J5bllTSU9iVmRDNGl5QXhUazdKVEVSRVlMcWZVM2czZktjWWhSTHJyaEJV?= =?utf-8?B?Q0srQWJ1OVVEdjZPS3MzRUl4eVNRYzY5RGdCbHJkMHhERksrdHlTMnFvbWlE?= =?utf-8?B?aStTZnJ1c0tLSTdUTkhoeHFoL1p6Z1VKU1o0QTRnVW0zdTNaN2wxU3JWYU9P?= =?utf-8?B?aDlSSG1ocUpPZTFkMndYZkgyVGp4N0lVUDJJRUhhWlgrYWF1bjBXeGtGWG1a?= =?utf-8?B?aS9mcVhLeUt0RGczT0llR0ozRG1seVl5STJrMjE0VzdUNjVRU3pFSDNxMU1l?= =?utf-8?B?QkN4a05GSkxWQWw5SWlBL2tzcEFwK3dYdXI4L1cxK3lGek0xdmdOZVd3QjBu?= =?utf-8?B?OUE3SXI4UDFua3VlZ2xlbUhTSzllaHVVUHFjSy9hZ3MvdEpWQzYwcGlXNm9s?= =?utf-8?B?R2dNMVg5R3I3dHRNZzA3ZVpad1JZV2ZWU215MTZXTDhJNWpLSzBQVmNRPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYSPR06MB6411.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?STA2R0hTZVBmbk4weGl4M3pYcFFZYVpPYnlObGFYNFU0dTB3YzRBK0RQMHZS?= =?utf-8?B?YnFlS1VROEI5cStvRWE3QlpWTGN6cEVsWDN6Z2pXUjRwN1owZ2FWT1YxWVdJ?= =?utf-8?B?b3F1eGhva252cnN0eG5nYUZkK3gyMFNROHR6dUppS2ZTTWVOVUQ1UWJ3ZFJP?= =?utf-8?B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XRTc0wxNkpJNUpCZW9JcDhq?= =?utf-8?B?Rm9yaytta3UzcXZ6ZGpqdDJSZ3Q4Zk05dWVUaWVIY0E0eTFSUVoxMnRaQmxK?= =?utf-8?B?bFZqMDFlQmM2S0l0eXN2T09QYUlpV1hNZTR3bUpKekRRd3BFeGtEZXIwRTJN?= =?utf-8?Q?xqVrI2OjFSzmyEfvJDMvSFEss?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 238e4c2d-bc8b-415b-724f-08dc754da362 X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6411.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2024 02:12:29.5078 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uWat1srdjWteF7vHzxa7keKWEJNedIHBPfkCLz9yrUix/XYhDfEa4SiskQ77bnqGXwLIpJnjaB5gwimoOIKXnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB6128 On 2024/5/16 0:00, Benjamin Marzinski wrote: > On Wed, May 15, 2024 at 11:42:04AM -0400, Benjamin Marzinski wrote: >> When a target calls dm_get_device(), if it adds a new table device to >> t->devices, then it's the first target in this table to use that device. >> If flush_pass_around is set for this target, then it also sets >> sends_pass_around_flush. In __send_empty_flush() if the table has >> flush_pass_around set, when you iterate through the devices, you only > > Err, "When you iterate through the *targets*, you only ..." In this > method you don't iterate through the list of devices (which is supposed > to be protected by t->devices_lock). I'm not very familiar with this area, I thought that the device list of an active table cannot be modified, so it doesn't need to be protected by t->devices_lock. > >> call __send_empty_flush_bios() for the ones with sends_pass_around_flush >> set. >> >> Or am I overlooking something? >> >> -Ben >