Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2468239lqb; Tue, 28 May 2024 00:05:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWWdDxjBEavZONNXSSFu5UX4H/To0baBWjPqKlbDwb7l0JCfnxoGhDzrwpp/Ms+inyBJrh2QRZAUuUmC8YDo51xh9XepOJylmly0XHlOw== X-Google-Smtp-Source: AGHT+IFbmr1V7txYVTeE7k2TUdvplCpTUhDT0Ezjy28UODRLnguBdIVWcQ5Rs8gJ0VGCDZ62leGB X-Received: by 2002:a05:6a21:9217:b0:1ad:746:3f61 with SMTP id adf61e73a8af0-1b212df03d2mr12236717637.28.1716879935146; Tue, 28 May 2024 00:05:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716879935; cv=pass; d=google.com; s=arc-20160816; b=vxwye3c8tGDQlgfHxkeSLGrktTY+DHxYybG6R2Uc9c0SnvsdXa6+zoDsyS1LWlfexS fowY5D8LkaqaciUlZnkSBD+vYxGnpr8L5K38HTei+TpuTihcNErwHKvly3/tviPwc9o3 X+nzNDPMGm/dZ+5G/BFW8VidzOmSAzOfEjC8mEE9gAKCyvcHasN71hJKheTBAj9NosVa Qw+9EGF3+Wj8xtEnBnKIntCi5D9Js2mjIP0b46nDmoI4ABu0B4h0Zq+WdheOkYTZO0t6 VVmtZef0egxqgo962h/laM6KyyrIdtSv1VFrWYHabhBYX9IkhF72n2rr5CRzOL3ahKo7 w88Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mKje+3SyL4WX4DitbWLg32Y7GsthIyzCgmjxuuYutfA=; fh=p08b70kLfAAaA4TdOh3NSj+II0P2WfWTnGybxdbAofI=; b=qNW+xjCYi/J31r+w4h4pOZ2DB0y36ckyCF0+kleRkqkPnshEVrQpYYkW66o6WQ2G0E xydAPDoj40grxvg+s71j6X7sWhrvQ8y1/sSVH/VH1p+MnrwKyF+iUV3xBbCemO95OYNp EgezLNm0o0GrpR7aqtbaAk/HrJSS1B/pNKyNoONW5AR2HSNIHBcfs4Orc9YQrC3Mx9uf +9kkE+ArbN25cLgVltr2rpNrqBYMWweWcfLhjhmtibjZEv1EKpIvvnROUdddiLF5dVtA MecGx2onSCyyLHBcbmIQf+7SmIPlPD2+XgIcJQUaBJwbwZxFcdYjge+034C7YFrvDDcD t9KA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eom72jNj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3428-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3428-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f44c78c0bcsi74041215ad.8.2024.05.28.00.05.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 00:05:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3428-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eom72jNj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3428-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3428-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 20321B21DF9 for ; Tue, 28 May 2024 07:05:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D8336EB4D; Tue, 28 May 2024 07:05:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eom72jNj" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0AD2D45024; Tue, 28 May 2024 07:05:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716879924; cv=none; b=DY1NYl6pWmtxSgAYTLomb63XGO/X3PiEuc24oL4nDI3B9tbTZ6W2Ddfq2BXwHzDMiBQDk8mMlj0/f436KjRro/3tUCVGVNIS4AoDDbp78T9u7gPHT6Hof+9I3WTKC06wdR/RuOfrexrfI7UneqCH8w0J/Ti4AzCoh8IDOawrkY4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716879924; c=relaxed/simple; bh=AJop6tQXrPDYxKxJR+T1Rffiqt/FIeu65U1e97Oj0gU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Q+UACKw+L1hyJEvKD7AkOVjGg7yaTFOQYTTG5MgtdUZBmNFJdU5ZakwKW6/wmaPJwDgxX16//ufAh1VezeIBBGs9RgpM4jxSW1KsXmY1XDvDf5U6ktyuq4ofFbqRSWoeJH1m+AGl1Wj8nTOL38wMdxgFI/vqu+G/jRsBtviU8fc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eom72jNj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2373FC3277B; Tue, 28 May 2024 07:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716879923; bh=AJop6tQXrPDYxKxJR+T1Rffiqt/FIeu65U1e97Oj0gU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eom72jNj3HosJ7FhOQZg1BOvkvv+TbQkvdMqQvXp6DUAwncaYyXag1KhYIrU2KUt4 SfI/QjZvWLC6+tmKpCjdGiHDsebwnmfPivr4bzGLAHtBoxCZ4/hjRDzAM5ivkxmWWg t3td3HpR69p60eyFuhhm2T2YWAcNxuALz7c9NqxvxEIUmOCWWJmrRBDt4wcjtWCO9F TYk228KTde9hrnrxbYaYWIJL5ECp0xD5cx7LouREsZa8Msbt847nxJiTRfRBCMRVfn 0Rj3nbSbLjJ244Wlhpt7wF4CI8SJlTphxmOwufB7iUsOj6JVTKPzUeztCNyQzRoZKI 26v5JC4X2+BFA== Date: Tue, 28 May 2024 09:05:17 +0200 From: Christian Brauner To: Trond Myklebust Cc: "hch@infradead.org" , "jack@suse.cz" , "chuck.lever@oracle.com" , "linux-fsdevel@vger.kernel.org" , "linux-api@vger.kernel.org" , "alex.aring@gmail.com" , "linux-kernel@vger.kernel.org" , "cyphar@cyphar.com" , "viro@zeniv.linux.org.uk" , "jlayton@kernel.org" , "amir73il@gmail.com" , "linux-nfs@vger.kernel.org" Subject: Re: [PATCH RFC v2] fhandle: expose u64 mount id to name_to_handle_at(2) Message-ID: <20240528-restbetrag-zocken-df1f009dee04@brauner> References: <20240523-exportfs-u64-mount-id-v2-1-f9f959f17eb1@cyphar.com> <20240526.184753-detached.length.shallow.contents-jWkMukeD7VAC@cyphar.com> <20240527-hagel-thunfisch-75781b0cf75d@brauner> <20240527-raufen-skorpion-fa81805b3273@brauner> <49b6c50a50e517b6eb61d40af6fd1fd6e9c09cb2.camel@hammerspace.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <49b6c50a50e517b6eb61d40af6fd1fd6e9c09cb2.camel@hammerspace.com> On Mon, May 27, 2024 at 03:47:33PM +0000, Trond Myklebust wrote: > On Mon, 2024-05-27 at 15:17 +0200, Christian Brauner wrote: > > > > Returning the 64bit mount id makes this race-free because we now have > > statmount(): > > > > u64 mnt_id = 0; > > name_to_handle_at(AT_FDCWD, "/path/to/file", &handle, &mnt_id, 0); > > statmount(mnt_id); > > > > Which gets you the device number which one can use to figure out the > > uuid without ever having to open a single file (We could even expose > > the > > UUID of the filesystem through statmount() if we wanted to.). > > > > It is not race free. statmount() depends on the filesystem still being > mounted somewhere in your namespace, which is not guaranteed above. The unsigned 64bit mount is not recyclable. It is a unique identifier for a mount for the lifetime of the system. Even if bumped on every cycle it will still take hundreds of years to overflow.