From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 421F74137A2; Mon, 3 Aug 2026 19:13:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.15 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784402; cv=fail; b=g8z9jn9pr/nJ3onG612djUJkP0D+IfhdY/kcFN2xrxwZf1iTqwQpnzTtZHl3DNQC8LurfWwBqQ0cdaiXhpCXKmrwbTBvl9qc9OZBoy4kRKo+ETpZX34BBNjWOgvyhKk8QFwpdNJ83gjx/0IW1xN7F1yfVEhRHS23bCWULVOk+1c= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784402; c=relaxed/simple; bh=SytbcfeZaHxoVaipC5rgpiLVpi8/WhRmoTXieS6ceH8=; h=Date:From:To:CC:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=E5vZIMvyFKbWlhKXz7icYdEDVLwjJwooBVZP4OrSv2NkAl36tVqeGyuCCZIJqnHzGokO4hKpR+aZiYztCrGOldXDMPJ249d//OwZQJ453/kYOv9bWSAQJTIJhSAMqFMzqxXQdh/YjA+6gmwxmLnPlTlxRBjphE5uvz8HSoiFbzw= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=kRInuu3F; arc=fail smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="kRInuu3F" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1785784401; x=1817320401; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=SytbcfeZaHxoVaipC5rgpiLVpi8/WhRmoTXieS6ceH8=; b=kRInuu3Fi47kroW2j2AAtp+7lOPv/YZA6k6fDlE7a441RBGAv5V+gxlJ 0ez7yq+9GLIXi2x17Ynxv8eD2rgwUN2UYRN8S1ahmnGq2LiFCfZf9e0vp c7SexOENpazQkNGqS3KbFOI1MPDwQw1u8eKzNFTurypY/FqWnGEahpQ7Q d48hqMZvrcDqoO0EwHX1QKfYmmAPKoDLTj//3WQItkHvCclwVtFmCK5B7 sJDVz/W/dxAL1LHRNrya7gsZg3YxOE8AZj1xxVbeS78zXD247XzTstY/f Ad2Ko+7017SDIkXCMLU1QCVL38so2Ql85hHCAFFxxDA1OkPrES3ZdzjaE Q==; X-CSE-ConnectionGUID: 02SKf0lJRSiLLEzzFKQlTw== X-CSE-MsgGUID: OPvT9DiCSFi8oWdQiOwuqQ== X-IronPort-AV: E=McAfee;i="6800,10657,11864"; a="86450866" X-IronPort-AV: E=Sophos;i="6.25,203,1779174000"; d="scan'208";a="86450866" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2026 12:13:19 -0700 X-CSE-ConnectionGUID: JkSYJ321TsCswX8t/h7CQw== X-CSE-MsgGUID: GWsQiLEZRZuJU3VQmtvoFw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,203,1779174000"; d="scan'208";a="265562869" Received: from orsmsx903.amr.corp.intel.com ([10.22.229.25]) by orviesa005.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2026 12:13:19 -0700 Received: from ORSMSX901.amr.corp.intel.com (10.22.229.23) by ORSMSX903.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Mon, 3 Aug 2026 12:13:18 -0700 Received: from ORSEDG902.ED.cps.intel.com (10.7.248.12) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45 via Frontend Transport; Mon, 3 Aug 2026 12:13:18 -0700 Received: from SN4PR0501CU005.outbound.protection.outlook.com (40.93.194.18) by edgegateway.intel.com (134.134.137.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Mon, 3 Aug 2026 12:13:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LywHQ6SB2nQHi9uFdJtXHlSySk4tDtFVIKUZ0Ip2GBg6ptep7iZR9h1mqKRaDT6jAnTCc+nku9wIMzCUz8SyYnRoGQDo6JgTMkz6crmR58Uhz7SYJJn6qKuXWVaYicw49PmCXvnWi5PBUXwgmtd8ECG3D9f9J0MotCZvhck2pKRC4Lb1jE4s5oWwJZ4gxCmVE97QEb+E8y11IiTojsLU7aa5z9/Ldeq/poHUbL7TV2muxK+6uUX59600nOtWYjkaDJgodCi1+ulNtTxN/8ZsCkk+hwW54X6klsF8RcOcE08Fi1p3oiTJmdKH747PXYIHd07aMuLOP/8dhshuTHXhAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=046wWEXFMPQxW7g0j3SNslQrjij1fHSQ90cqA2riIb8=; b=vD18FoAaBv+jnBYieu+ASUtMcAlf5ZUa1Qs0MK/ZPjInpaOHr05BuY+cvASYf3sE7c8w9NIf+6VynpsumXtbIHE7303O6hGT6WRtcUY8S/pe35P82IWX6pjEVRkuhTxFVjEIeLYKHjrqWTzgxQY2sCQ53d/z1N44jU6K4OymyQCj8UkFI2NX0+nK3EbIiCyKCJBgH4R5MiFBQVKyHHICWOL5vxnZoDbECr5hRKgmV1xoM3KNilEOIr7PYzpyB8gd4utNDRJ+Yg76hJDNRESDTZNL/29+0/nt3tWxlsZsYyBhI62K3HUoqstwpHVo/aqPWM3/OSgyGUiSJ7l2aStmXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS4PPF0BAC23327.namprd11.prod.outlook.com (2603:10b6:f:fc02::9) by PH0PR11MB5094.namprd11.prod.outlook.com (2603:10b6:510:3f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.18; Mon, 3 Aug 2026 19:13:13 +0000 Received: from DS4PPF0BAC23327.namprd11.prod.outlook.com ([fe80::e721:90d7:9214:2d53]) by DS4PPF0BAC23327.namprd11.prod.outlook.com ([fe80::e721:90d7:9214:2d53%6]) with mapi id 15.21.0270.017; Mon, 3 Aug 2026 19:13:13 +0000 Date: Mon, 3 Aug 2026 12:13:01 -0700 From: Alison Schofield To: John Groves CC: John Groves , Miklos Szeredi , "Dan Williams" , Bernd Schubert , John Groves , Jonathan Corbet , Jake Edge , Shuah Khan , Vishal Verma , Dave Jiang , Matthew Wilcox , Jan Kara , Alexander Viro , David Hildenbrand , "Christian Brauner" , "Darrick J . Wong" , "Randy Dunlap" , Jeff Layton , "Amir Goldstein" , Jonathan Cameron , "Stefan Hajnoczi" , Joanne Koong , "Josef Bacik" , Bagas Sanjaya , "Chen Linxuan" , James Morse , "Fuad Tabba" , Sean Christopherson , "Shivank Garg" , Ackerley Tng , Gregory Price , Andrew Morton , Namjae Jeon , Lorenzo Stoakes , Greg Kroah-Hartman , Ira Weiny , Pasha Tatashin , Haren Myneni , "Pratyush Yadav" , Giovanni Cabiddu , Jiri Slaby , Ethan Nelson-Moore , Gabriel Whigham , "Aravind Ramesh" , Ajay Joshi , "venkataravis@micron.com" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "nvdimm@lists.linux.dev" , "linux-cxl@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "fuse-devel@lists.linux.dev" Subject: Re: [PATCH V12 01/12] dax: replace exported dax_dev_get() with non-allocating dax_dev_find() Message-ID: References: <0100019fc572ca94-ec363dd7-3a77-484b-b4b7-f2503a0931a6-000000@email.amazonses.com> <20260803022817.75759-1-john@jagalactic.com> <0100019fc5737596-636bde4f-7fc7-46a4-b011-63870098df09-000000@email.amazonses.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <0100019fc5737596-636bde4f-7fc7-46a4-b011-63870098df09-000000@email.amazonses.com> X-ClientProxiedBy: SJ0PR03CA0099.namprd03.prod.outlook.com (2603:10b6:a03:333::14) To DS4PPF0BAC23327.namprd11.prod.outlook.com (2603:10b6:f:fc02::9) Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS4PPF0BAC23327:EE_|PH0PR11MB5094:EE_ X-MS-Office365-Filtering-Correlation-Id: ea898f98-ae83-4756-6979-08def19343ab X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|23010399003|376014|1800799024|7416014|56012099006|10067099003|11063799006|5023799004|4143699003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: 97GVJFa+68zloqTplDikveh8ny7ychBLCx4Dw0HruIdmMsRb5ex7GE0KKeaRjW5FCcpWP+sJbualQNPk2Yd5al20MI/d04tLupP10TNglXfTirHfrvS+AG4ZtjjFY7eCmRjqlhD0DlKmyaNV5jFfLP38VjNsmTDl8IJdtcSZkN+jWKcZkOf8+ERXBLtuFg5vwnjTHsvybg16hcZdQmpLPMzFclGOivAlV0gURNT1nwV1vLlRUIdi7AT5jG+bxOCnb0x790NFqLIwSeWHtiQCLo6RkGpw0+hAcxpEv5ytrJ1H/iYUSjcNr/vVd7kVLgAQkMoOIXRKGEQTPD3pr7618X0toAn0izYHVyrpyqPy6oJ3rFuHhD9eZZNj10yOyfjXEpeFCALCzHHzD4YhQdGyQUMBuYWOfIDYbqanbEjCgIX07cpPl5S21ZFeCXFTw3CRdJ0Z2rENJbAkJR3H+ssJPveqX+Y7NLNTJDxFiDJVlmwqGVAf7vnJxJvOA13w9rNxYYedb50RM8jN0JUDmo3FmW4YLcyt3N5YnuwuP1ixz/EqbBeyVIUNrFRrY22dW458VzbXLZJVJhmoXiKV3mX3/5K5n61G4xIj/IF9rSeA+RGs3MeMtH5s2YojJpGwrLWKAjTy1J6m8lcQL/h9u8hfhjWAMNf+ipc573BEtAvQWjM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS4PPF0BAC23327.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(376014)(1800799024)(7416014)(56012099006)(10067099003)(11063799006)(5023799004)(4143699003)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?i15FoE2iJVKTjhNM3AC0uIqwbeQ7FKI4Ei++m/48lS0jbyzb5Jm6ALA7VJv4?= =?us-ascii?Q?N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55NuHZSbakmEX9lB/Sw1x3l0rIOmywtlzour22KFA5+RbobGKKoC+rVaQOJezars4jz2YWubQJNnKQknP7Fa099GOJ60FNwipjM+030Ozxb6ybs75cF2OsfrdecXZ9jnGJuaC2omvzm/rBwdgo99C1Ee9nI0TpCAsL0VBsAGyTgfjM2IU/j+yex6Bfv2qSEWxf9Bw/4gPKPBxMDhqoZBcO/CBYcYUSJKcXefVRkBUAzJ8oX+2txLHGqCvdJAvgFzGuOK7w16gfyN6Vz1wOdikUS2eI/bqBjQrmtObXrM8u9XY6p58w== X-MS-Exchange-CrossTenant-Network-Message-Id: ea898f98-ae83-4756-6979-08def19343ab X-MS-Exchange-CrossTenant-AuthSource: DS4PPF0BAC23327.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2026 19:13:13.2814 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5IhgEM62f+Ff2vuzKdIeTvcXMIuXgKt84XO9kf1ygnQhiQtziiqH8cwakhmF0pD5tpwt05Z5ccNd9spgdDKlOa0111GstBmCeQ0uGi6jog0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5094 X-OriginatorOrg: intel.com On Mon, Aug 03, 2026 at 02:28:26AM +0000, John Groves wrote: > From: John Groves > > This fix is in response to a Sashiko review, and some subsequent > analysis. > > dax_dev_get() uses iget5_locked() which creates a new inode if no > matching one exists. This is correct for the internal caller > (alloc_dax), but dangerous for external callers that look up devices > from user-supplied or metadata-supplied dev_t values: > > 1. A new inode is created with DAXDEV_ALIVE set but no backing driver, > no ops, and no IDA-allocated minor number. > > 2. On teardown, dax_destroy_inode() warns because kill_dax() was never > called, and dax_free_inode() calls ida_free() for a minor that was > never ida_alloc'd -- potentially freeing the minor of a real device. > > Add dax_dev_find() which uses ilookup5() for lookup-only semantics: > it returns an existing dax_device with an elevated inode reference, or > NULL if no device with the given dev_t exists. It never creates inodes. > A dax_alive() check under dax_read_lock() guards against returning a > device that is concurrently being torn down by kill_dax(). > > Make dax_dev_get() static again (internal to super.c for alloc_dax), > export dax_dev_find() instead, and update the two external callers > (famfs_inode.c, famfs.c). Also add the missing CONFIG_DAX=n stub. There are no external callers yet as those arrive in subsequent famfs patches. > > About the 'fixes' tag: this removes the export of dax_dev_get(), > which was flawed, and replaces is with dax_dev_find(). It feels like > the fixes tag makes sense for correcting an ABI error. > > Fixes: 2ae624d5a555d ("dax: export dax_dev_get()") Hi John, I think this should be split. Please send a standalone DAX patch that only removes the dax_dev_get() export (make it static again, drop the header declaration). It's unused in-tree and unsafe for its intended use, so it stands on its own with no FAMFS dependency. I'll take it through the DAX tree for 7.3. Please drop the Fixes: tag on the removal. IIUC the stable team uses it to pick backports, and this shouldn't land in 7.2.y. Removing this fixes nothing since no in-tree code calls the symbol. Name the commit in prose instead, something like: Commit 2ae624d5a555 ("dax: export dax_dev_get()") exported dax_dev_get() in v7.2 for famfs, which has not merged. The export has never had an in-tree caller, so make dax_dev_get() static again. Keep the dax_dev_find() addition in this famfs series, so the new export lands with famfs. -- Alison > > Reviewed-by: Dave Jiang > Reviewed-by: Alison Schofield I think you can carry the tags for both patches because the code should end up byte identical. snip