Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3091505lqo; Tue, 21 May 2024 06:46:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV4p5eWjWmGI0aRiQnwCNTEHUK8xhO7UDHNBkRBHk7GdoVTJDuFvt/QLhvtSP3eIg23qhAePktBUmrLHwF5N91n+hskqJDGN+LRL723Ig== X-Google-Smtp-Source: AGHT+IGyN/B8KJL/tWz0TucejrmShOjjKC+u4nGnacQMbRYybGKA8xa3+bTjVySwNbxP+5fYqTPp X-Received: by 2002:a05:6a00:92a8:b0:6ed:41f3:431d with SMTP id d2e1a72fcca58-6f4e01b96b3mr39785888b3a.0.1716299168518; Tue, 21 May 2024 06:46:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716299168; cv=pass; d=google.com; s=arc-20160816; b=hbSxRObNIxd6Zlbmta8ZFb+8X59GVszg1Eq9BYW/cFhs3ytGug84Dst7P7coWgSEIM VEPuPhAYNsssnBrkrSbqgnj7PfWXJzwiIxMxS8w6Fb6ZlhDNY6pZKkoZQyDJRGgOpOeu irhuX6klE0+3Mg5t1RzU7UqmGVzVSYf5wvV+duZF2GEIJvtS9M6c5v027dlfeFrpUxhk KFRASulD0hGIYAGvBkP8/HUH7XUmVrG6MoK3McSNRsP7X2T31RKmkgz778uF1m0XtjM/ 3gWpX8/qOsT9GU1BckZHZjajadAocSPBI0HLRefZPPQ5sk/BDXBr8329e/OWhqwXvjQ7 fRlQ== 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=Kz0p2KqYalb+//UbEq5J8mFtF6vOHmDeqsw9Zvu+4Nk=; fh=Aq2n6fBd+X1niwSLRXvtIDueHUGoCOc9VgC45m37d2Q=; b=s6KaCuZvfDtmOvJZy9Nk1tO4cH/uKQlaALw+NkxNqMBiE0gTy/Igb92NNZtA5SKGAa vuLlWpsp2Gz9dpPFa7ampPfZm3aB4B4Z4TAh21Pcdxtkgm6Hr1QcFZ9s8F9SamzEfjDn bnaF7PJnM01K7KBDECovzWxenIV3EsH28YQ0p8C2vZ7Y/gDDOGe5Q3VnFTYRDPHoiGmK EIUpNwcqpxO3bkYl7oGPqI4n5utsP6z9VD7AKnrNVP9qeOF3rwQ4w4Mr/NolxBBG4Qva FbgilQLjq2mE0BgD9KQ1mTHT9SA8dPF/IiRZdDVZapMU9F5yXmX7MScnl+dgFgypFW+V 4BpA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=doSvk6gj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3308-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3308-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 41be03b00d2f7-658600870d1si1504497a12.572.2024.05.21.06.46.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 06:46:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3308-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=doSvk6gj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3308-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3308-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 74C38B207B1 for ; Tue, 21 May 2024 13:46:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE69C75818; Tue, 21 May 2024 13:46:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="doSvk6gj" 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 B054455783; Tue, 21 May 2024 13:46:00 +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=1716299160; cv=none; b=ArVeStcguuuMxGfvVQepUPCB8wFB7abZSX80rwTbB7XFFLB9/y53LbPsLaIej88rd4d6ECVy4ELLrdvibanHg3dVjwm9tZVYkh6RZbzFJNZg+m7IDKKA/CK5VGo99y3ZNvA7/OrWim7+we+bGptZpseX3q2dleFKHFBaKHLeB/M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716299160; c=relaxed/simple; bh=FLQbbXjucJdpPz4isaAj7e59xfrG4oqG7uu7VlLroSY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bAoREYrUCUYRgBt+apnefKCquTQ6kj/dnpHK2YMjUUDzMLfAeM/ZqSvlSHW3ZyuSjyH2P18ljjDgOnehQbjoSZok2LXPtAl6PtZapZgK+KKm00+kj/9j9WI4W0zLvruryXxeyteG0d6Zv2F74mPFv3SUPamgtgiDK31R9OG3dPQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=doSvk6gj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEEBBC2BD11; Tue, 21 May 2024 13:45:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716299160; bh=FLQbbXjucJdpPz4isaAj7e59xfrG4oqG7uu7VlLroSY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=doSvk6gjtGjiGe+wKSK27hcw9Yl6R5tpaY1HdJYxxTGuXN7EMEt064MbBRUw9Kf8q E+7V/3YB1xIyuTAqYPuCCXjKyM/9QsjdSSyqsGXjkwRKHlNrn4BqEDCCVWJgcnUWH8 wFQvlANd0en80wsfSwEetQ+HyHW8YaWn6ygJuUZDBRSrZUMIORs/qtHdXce25/83SA 3O9Pidt3H1pRv/3jSbcR32SNPqeVF3VqDWztDZ7PMUqhVygJQo6aQVviI1XXMeIMsA +gzV9rO74sH5kkGNT4QDbCFDPiA53dFgJediivdlNxDCRQDmhk6Qu8tDO/L5YbgGSU 1mMaWsRf1Gijw== Date: Tue, 21 May 2024 15:45:42 +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-verplanen-fahrschein-392a610d9a0b@brauner> References: <20240520-exportfs-u64-mount-id-v1-1-f55fd9215b8e@cyphar.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: <20240520-exportfs-u64-mount-id-v1-1-f55fd9215b8e@cyphar.com> 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.