From patchwork Fri Jun 30 04:26:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?6IOh546u5paH?= X-Patchwork-Id: 13297567 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 9E3D8EB64D7 for ; Fri, 30 Jun 2023 04:27:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229576AbjF3E14 (ORCPT ); Fri, 30 Jun 2023 00:27:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229801AbjF3E1z (ORCPT ); Fri, 30 Jun 2023 00:27:55 -0400 Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01olkn2021.outbound.protection.outlook.com [40.92.99.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12DC61FF9 for ; Thu, 29 Jun 2023 21:27:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S6pK7e7h+llzSr8HN7uR0YHzWrxAdERLGrnC/vsr8Yfn2szdtzwkoWn4SCSs68RcbiQ2XEYip/+h804w0wS9xzXpvl7mcWLowgfGRxdmPzl0VPUecff0rWoySKv3bAjuiFcpHVOlwy/JAhVGPsN2E4gFcaLSk2k4jHca6XCmiRYRmcg2HjUkWfzZtHjaZtDREjUFA6xoBzTWKNTINxzrc+NwPElqebRyUQF79g7t/H9q4TMchAPiIfvv6xKmKomS2+G78DWfZfXB8s15QkT6cQPYNEoy8Qe3Qujbhtxrf/JwHXBRg/4gVotV6o4GNFAYQ5igpVxXYHGQaN+CLraxZw== 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=lMfM5gVB7hELYWxWyWGAkSsOZ5IpqDp0m2dklpUfTuc=; b=Ut3S+oVLfKSSLBBYyzJfEqaZeV33vPEgdeK4rCpHdxaRmg6nTQjjIbSk9nu/cE8jXe2d0ThZjbBEZrefLxikJGO7BPETTStsN9oNnlDOXTvpMKArZewCoLQ10N73lQm1NCqsT2NS+ifu4DBZ0VQBrKemdkGxLu2X8gI5FfsT19php6Ij1huw9KRgOq1yHN6FYm8D3cLgPkacoCZik51wJE5zIjA1BuHzyKz+1vnGFVjfyS8Jzz3WDX9bL5VA966nD5f2QBA9Ny+1sLNZUBAA+ovIDVm+i7O24aDcINfp7QPe5gyG89pXUJ/mdcpAbXMvF/EgpZNTROD5k9Oy/ohFHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lMfM5gVB7hELYWxWyWGAkSsOZ5IpqDp0m2dklpUfTuc=; b=Ln7YJj8zU6lg+6ncXJ2J18cusorv2/XjCDr3lah8BZaovq+qDjxVgN1wynhOAq2QYRk+vSmKsuFz7U9nGgWRL/IY3/BDyLZz+3rQO/5snIAO0+LjP7LYmN0uJ8Zyo03RkEifOpRDhUEjf7y4aLGCTxtx4+bNaWlMCe5++SQIRhp3gK69/xbcpKdeJHiv9PM6CMEWRY2lortAlwVYWLPQ9Qz7OYxSrzL5c+3vWanLLSa4ECV7CHbKdTjlAkC7dSN+Uw4eUQe5Buk9YS+m8xT93Jx199VzUsYN+Tui1KHTbnj8EUnWO/FtmfBzh6qPBOgLgNbQyNOtQHK/FHY9K3xPoQ== Received: from OSZP286MB2061.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:180::6) by TYVP286MB3104.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2ac::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Fri, 30 Jun 2023 04:27:50 +0000 Received: from OSZP286MB2061.JPNP286.PROD.OUTLOOK.COM ([fe80::3bed:4407:7f3d:7387]) by OSZP286MB2061.JPNP286.PROD.OUTLOOK.COM ([fe80::3bed:4407:7f3d:7387%7]) with mapi id 15.20.6521.026; Fri, 30 Jun 2023 04:27:50 +0000 From: Hu Weiwen To: ceph-devel@vger.kernel.org, Xiubo Li , Ilya Dryomov Cc: Venky Shankar , Milind Changire , Hu Weiwen Subject: [PATCH v2 0/4] ceph: account for name and fsid in new device spec Date: Fri, 30 Jun 2023 12:26:26 +0800 Message-ID: X-Mailer: git-send-email 2.37.0.windows.1 In-Reply-To: References: X-TMN: [PBU2KvWzf+lcP/y/9Q/bJOo12cWaWgi9v9BRfVBj/FQWsmTnbSbp+AjpAkZeI7++] X-ClientProxiedBy: TYCPR01CA0044.jpnprd01.prod.outlook.com (2603:1096:405:1::32) To OSZP286MB2061.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:180::6) X-Microsoft-Original-Message-ID: <20230630042626.1653-1-huww98@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OSZP286MB2061:EE_|TYVP286MB3104:EE_ X-MS-Office365-Filtering-Correlation-Id: 002319f9-fcc2-4de7-a539-08db79225cf5 X-MS-Exchange-SLBlob-MailProps: znQPCv1HvwUykhYCLh9DY1CjAm5WozgfdufPHlfgLwzWMjbxIQIAGwzFW2xEhd7AxQXjYz+vkLkpSkafRFhe6Q+HUrjN+GpsoD/9jxJwaBBhW9uJw5az6ft9xTR3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EY9wF7gezXGdAmtj/ajVx8Nk1fSmXE9/CNKh/iDtnpAKcKuU/SIbqLDBJUObactM6zFJWyGs2anwLXa0OA/Z0Pg+OA9uOaQ1IySm08ZwYQ5h3hexZ1W4yVYS7yqE3qpIdllOFauE4SccuYWWu7zxvMo6XI1noC0SCKzJ96lFnWD3a72fINnmw1kIz2+dBGsIuMvKEPcZgqa1Nm4WFbY6D2zbGDZK7/N25cX0LDR2o2oeOYiFfwb9a5lY/BBulDRAog5pPMSO3W7hGcmXNK79O0sSeIf4YGlgXZRv+M7jl4NVlzw2+W+JHchUG9t9tkWuxVC5YxTJAbl3PnghTRMRwTlcMXqMBFRaEIIWAJ3EPvW6XuKJa0i+GgpnOhD/jNMMf92VXidCt4t50ROB3W9OUkLE6XltwEsnQvTQgkwBouxtlyFQKai4qctukgv6dMi8+HjRy3Oa8CCVSdXzC6YPqU70Qml8+HL/pkSEvFLE3Q9jVoMd3ksRK1xuMKlZDGyBHSRdr/dHsHpezUscy4eYgot5xs5yq7k0Q== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 002319f9-fcc2-4de7-a539-08db79225cf5 X-MS-Exchange-CrossTenant-AuthSource: OSZP286MB2061.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2023 04:27:50.4440 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYVP286MB3104 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org We have name and fsid in the new device spec format, but kernel just discard them. Instead of relying on the mount.ceph helper, we should do this directly in kernel to ensure the options and device spec are consistent. And also avoid any confusion. Changes since v1: * Changed my email address, since I have graduated from university. * A slightly more efficient `strstrn_equals' implementation. * Make the mismatching error message more clear. * As suggested by Ilya, rewrite patch 3. Now it does not touch code in net/ceph, I now allow options to be overridable, and check the device spec is consistent with the final resolved options. * Added patch 4. Hu Weiwen (4): ceph: refactor mds_namespace comparing ceph: save name and fsid in mount source ceph: delay parsing of source after all options ceph: allow mds_namespace to appear multiple times fs/ceph/super.c | 68 ++++++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 29 deletions(-)