Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3109953lqo; Tue, 21 May 2024 07:13:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUzQTp/OuHNfhl1AfgFuX4KpTnNSi+IlcmiR6NBlyz1EUJdhrg58yU/pMmg3gENxmQmb6oulZ4vO1JAREFiObyRR1oTih6GHcjKzKXswA== X-Google-Smtp-Source: AGHT+IEgojDvtY7+FW7jD5OGA4m4S6CppCwevxtDXwaUkJ1ynvMzWBmQJLha3zw0LCr8AHK8YLfz X-Received: by 2002:a05:6a20:2d21:b0:1b0:180b:218a with SMTP id adf61e73a8af0-1b0180b22a9mr25182583637.13.1716300800968; Tue, 21 May 2024 07:13:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716300800; cv=pass; d=google.com; s=arc-20160816; b=y1aNWg9xa/+v5ytSooIJp/7WVxmKLBD5l2rRfc8tGVvN4ZZRhbp9zObczVm/Xr8VyL sJvB+yJ3yupApzNCbKkDoJG5eT9ZxO/beewbvr0JQgxTtaLjs7gkHjowcqv8DI3kkOKZ sbkIeWaHpsfgpRSFzDvLpv9zVJWmacGakciNgGyvDOVOKzmyo3xJ+Ng6D/ZS92C/xcdM wYmGk6h+/aaxYE/WD3F0ujKjv1U7wH8Ex+4OREOW7ZfYDJMuLWIRgMJhYbuWKsybsjNP y42IMdPKTCCmW4wFuNqooX7x9E0OocDDwl4vLBMNonsBUXSrSD3XDkFp3EK3u2BIxf2L ZEgg== 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=ULC4MSU8KrX5SsBEOFMb5Mt0E/OIRKzcIXdeNidlvOI=; fh=Aq2n6fBd+X1niwSLRXvtIDueHUGoCOc9VgC45m37d2Q=; b=0aigFP0l7TvTG7BlgNRjVMAvT4hIOcJoeUSNOq14tTnyyia483kes0hBuhxN5FsZT7 XE8ECNSHJkuiX5IMIrrg43uMmzGdx/E2sMO6L5gVXE49tK+fH/08bRMYbrt2HfiGPvW+ vWQTaBOBhBIYcEY4WyzRkrK0HGmwCegYwLGdWlWVuXzvUokWMQVNLu1l87kMXAsyj3ec AebIlA2JP8SHA/zR/fdQwQNI6AQvg8BRcR2F62UbS89wwaHzDlcB5QRieaCFf7y+OEEn ES46EbYoDZ5GGGFQ9ktWthvlGfldaah5NuyEppW9DyQuPFoX90hzJPgdvqpaHWsCURmi HN4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ckWFWUjQ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-185066-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185066-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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-6588301703asi10707299a12.645.2024.05.21.07.13.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 07:13:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185066-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=@kernel.org header.s=k20201202 header.b=ckWFWUjQ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-185066-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185066-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 97C482850DA for ; Tue, 21 May 2024 14:11:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 61ED77F7DD; Tue, 21 May 2024 14:11:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ckWFWUjQ" 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 80C1E7F48F; Tue, 21 May 2024 14:11:40 +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=1716300700; cv=none; b=Ltg8xy8C11cAKED+c/y1vO4ah2aAXqX+6fnjHyJsbttQOjnAOoKjg8RYLEwvYTOwJKpsIIHVFuUM7M+VoqhztHHz9QaMuyYj/kmP8etUiQ8IBqNsPnlFjoV1aB73C7ruGPBf9/lJIV7iEBbPoMh4SbAA03/26dFZ4P3o01kgzfg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716300700; c=relaxed/simple; bh=J6B0Lc94l58dW3Qn3r+3rIM76lUefVIUJwnMg9LpUyo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BDvlwy9+dIhX0c3zOeg7OZ4lNwmlCiq2+7KN1/KnblEf6823gHU+xyEyefUszH9t7VCmKMffOj5UVxHbxJG69FXzVQxoBkbyHpbx5khU5RJRYJrilcFqBa/RCVjcLd9AHqz4BwUUZjXjgklJ9+KAGLRcNkqDYHteh2dy6C/tzAg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ckWFWUjQ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D02B0C32786; Tue, 21 May 2024 14:11:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716300700; bh=J6B0Lc94l58dW3Qn3r+3rIM76lUefVIUJwnMg9LpUyo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ckWFWUjQEtPQn67GXpYz4nso1FlJFjYfJ8FLQFFTuepVPWYCOl+Mm7D+eHB/qBwp7 RMf3ucvv2948+g8xPmTcPw1FVS1aobUR+iv2H4AGS5Q9zX1OkdwLjmcU9GOnqbdXOL OIsE8/NDb6nGqCeWmagNCLF5zaKtkOfIZ/s3LrTswj4FTpd6IX3keUTv1MiF0VZiBN WDBvFHvCXShYuR7eJ0O3uUHUkJoQbCRSFgq4r4UCZ1WZL7v4dEAKpSUTprxYQf66HQ tKurOlglct53yDGyR08sk3G+xUsxlV5eYfFJoYisNCHbWiYMr6AiramnQ7ycW+YZcE LOeLEp+ssg6vQ== Date: Tue, 21 May 2024 16:11:35 +0200 From: Christian Brauner To: Aleksa Sarai Cc: Alexander Viro , Jan Kara , Chuck Lever , Jeff Layton , Amir Goldstein , Alexander Aring , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC] fhandle: expose u64 mount id to name_to_handle_at(2) Message-ID: <20240521-patentfrei-weswegen-0395678c9f9a@brauner> References: <20240520-exportfs-u64-mount-id-v1-1-f55fd9215b8e@cyphar.com> <20240521-verplanen-fahrschein-392a610d9a0b@brauner> Precedence: bulk X-Mailing-List: linux-kernel@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: <20240521-verplanen-fahrschein-392a610d9a0b@brauner> On Tue, May 21, 2024 at 03:46:06PM +0200, Christian Brauner wrote: > On Mon, May 20, 2024 at 05:35:49PM -0400, Aleksa Sarai wrote: > > Now that we have stabilised the unique 64-bit mount ID interface in > > statx, we can now provide a race-free way for name_to_handle_at(2) to > > provide a file handle and corresponding mount without needing to worry > > about racing with /proc/mountinfo parsing. > > > > As with AT_HANDLE_FID, AT_HANDLE_UNIQUE_MNT_ID reuses a statx AT_* bit > > that doesn't make sense for name_to_handle_at(2). > > > > Signed-off-by: Aleksa Sarai > > --- > > So I think overall this is probably fine (famous last words). If it's > just about being able to retrieve the new mount id without having to > take the hit of another statx system call it's indeed a bit much to > add a revised system call for this. Althoug I did say earlier that I > wouldn't rule that out. > > But if we'd that then it'll be a long discussion on the form of the new > system call and the information it exposes. > > For example, I lack the grey hair needed to understand why > name_to_handle_at() returns a mount id at all. The pitch in commit > 990d6c2d7aee ("vfs: Add name to file handle conversion support") is that > the (old) mount id can be used to "lookup file system specific > information [...] in /proc//mountinfo". > > Granted, that's doable but it'll mean a lot of careful checking to avoid > races for mount id recycling because they're not even allocated > cyclically. With lots of containers it becomes even more of an issue. So > it's doubtful whether exposing the mount id through name_to_handle_at() > would be something that we'd still do. > > So really, if this is just about a use-case where you want to spare the > additional system call for statx() and you need the mnt_id then > overloading is probably ok. > > But it remains an unpleasant thing to look at. And I'd like an ok from Jeff and Amir if we're going to try this. :)