Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2018450lqb; Mon, 27 May 2024 05:29:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWvFShnV6Z3tE57LDUvcd6ZD3k2uBqDxBWAUjBEuWd8K4Lyt2MOWQAW41XBx9m6sIx3srFdFiSbjlUa8kWfC6TtuoHXUfTkMsd+BoVrTg== X-Google-Smtp-Source: AGHT+IGfv1nfTYg5hFpLkELJQeQ2+XLaztmRcO0eI92s6b8Xa3wJfaAhLqp8hFrfC9f8w1aZSJ1y X-Received: by 2002:a05:6214:1182:b0:6ad:618b:82ed with SMTP id 6a1803df08f44-6ad618b879cmr75359116d6.15.1716812952899; Mon, 27 May 2024 05:29:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716812952; cv=pass; d=google.com; s=arc-20160816; b=kMaSmJgSyof+tx7KsrFl4LqjW5RbsuW5xV3DtLR8WnFrriZy2QCFXcNlMjTL6MjsHW s8OvoBxZWC0LokkfbrVZCyfmzxiuObkyyNgZJT66qDg3NuYWmdL1lxrKcaUgT05Nb2kE IJRxppuA82H1zC+WRBhaIWdMJMB5YGzv0CysHc7OqHo003d+giuPIIHFGefsCkxXtYuO a7AgmB4sFRSZgH5G+om0mqAFOpdVfMHnkddUiy0A2WoYluEAXDxlWG3fq9FZk1Fo0cgH 4eKs4IFcLTWja9oHweYshINZJIKT8nBJxbdcPzLaieCLgwMfeFHqlX+sLJXcI7W4+VBI 8YfQ== 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=0MZY4peopu1X/qvQs5GSubSzQBn/+skSlSxVeo7JM3I=; fh=VVA9PLnrJy99+CIRYuxwapdbmrefRiakInyegGkiaxE=; b=WWCEWk7QTLrrBRKpmS0Zibh9LPW7OhbE2oqQDvZe5oowitOCha8PGc3XKnYz0HihHT vSY91PRRZgEKuMtcN85W3xIB7gfyTVB9Gf4AOJCpenU3GwK0dqGWLFfIgdikUqOaQYqX juSZJdM77u8kdoZtkGxq1FH6DLOiyHxruoT/jQoKzU0M9gnU3qI+KGnqn6tG2W4jp6JS aGqDEocxn62+0Too0DEGTBZ/F0cVp0PwqY87uhTu7kqnG3P0fwRCjOLt6rQ4X2temySn l+Nvph/7mN2L+5QbXIqn+Tj6wYE9trvIv1Y/XFSHUkzHh4yjrUEcVlZ5IpslqTwzO5EZ nTwQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NK53lCa6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3405-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ad7556bccbsi43637756d6.197.2024.05.27.05.29.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 05:29:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NK53lCa6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3405-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 884E71C21FA6 for ; Mon, 27 May 2024 12:29:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B11D15DBC7; Mon, 27 May 2024 12:29:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NK53lCa6" 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 29E221581E2; Mon, 27 May 2024 12:29:08 +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=1716812949; cv=none; b=gOM4LO6LKcNsCzNI+mHALYIRewyWzV4UORiEwI9JclF7JBPzszFqaYYpd77BqhgELvewEBP035OrmNvB0A8LuJaJsCNGkc3lMsZrgHXz48u2kc0WkRWFkH9p2gJkL/3NYZ7XDqrZlc7eUdkLq+HEBEl4BcqCsUCnUdK1Jjp1DzQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716812949; c=relaxed/simple; bh=tjvtAIJXWm20T+mGM7vsATeimzw31eut/UyatyIrsoM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pptXKHl/62JOMooRPtu1ikR7ZRQ1D9iy+ds1BScwz9+036/H5HuOEqHjQR/oCcRcFmRq5gCkpQ8cD6HamGP4jCpZpGWeev+WigjsHap3mdIQOABvUi4uGxiC0rybO3kIV+cUDJiNQk5F+Gad+65BMd/8ZSmrtrGAPa60PWQ8xXQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NK53lCa6; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC8C4C2BBFC; Mon, 27 May 2024 12:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716812948; bh=tjvtAIJXWm20T+mGM7vsATeimzw31eut/UyatyIrsoM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NK53lCa6WM6ArMzjNGHzERvdmx3V5wpFDOMpAWjptfLLF7t3XUh+U4oByIOKr8I3+ JPNvKleNc/6bJGuoIhdx2tbR4E5XF8NcXRmhnvHx0Q1BTSCKCKz9QRr836h6JpOFRd sA+eyZyhLxG9dUNv4NSR/U5nbgFCnz4GKayN3O4vniNJuDBhXMJXAbf1AZcARzbdg0 auowumcTOLtNoqoCqJW055EaWjpUw8SMu4+tNzelkPSI8OjYt3x0fiCfclDX/57DTn mLBOVYfahi9I2LZ5GYrDamvXwaTV5v6Xm5DHgVBJyZ0OwexeuaXwacdNl3jAqraBS8 wMkvK8SXhdlyw== Date: Mon, 27 May 2024 14:29:02 +0200 From: Christian Brauner To: Christoph Hellwig Cc: Aleksa Sarai , 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, linux-api@vger.kernel.org Subject: Re: [PATCH RFC v2] fhandle: expose u64 mount id to name_to_handle_at(2) Message-ID: <20240527-hagel-thunfisch-75781b0cf75d@brauner> References: <20240523-exportfs-u64-mount-id-v2-1-f9f959f17eb1@cyphar.com> <20240526.184753-detached.length.shallow.contents-jWkMukeD7VAC@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: On Mon, May 27, 2024 at 04:47:56AM -0700, Christoph Hellwig wrote: > On Sun, May 26, 2024 at 12:01:08PM -0700, Aleksa Sarai wrote: > > The existing interface already provides a mount ID which is not even > > safe without rebooting. > > And that seems to be a big part of the problem where the Linux by handle > syscall API deviated from all know precedence for no good reason. NFS > file handles which were the start of this do (and have to) encode a > persistent file system identifier. As do the xfs handles (although they > do the decoding in the userspace library on Linux for historic reasons), > as do the FreeBSD equivalents to these syscalls. > > > An alternative would be to return something unique to the filesystem > > superblock, but as far as I can tell there is no guarantee that every > > Linux filesystem's fsid is sufficiently unique to act as a globally > > unique identifier. At least with a 64-bit mount ID and statmount(2), > > userspace can decide what information is needed to get sufficiently > > unique information about the source filesystem. > > Well, every file system that supports export ops already needs a > globally unique ID for NFS to work properly. We might not have good > enough interfaces for that, but that shouldn't be too hard. I see not inherent problem with exposing the 64 bit mount id through name_to_handle_at() as we already to expose the old one anyway. But I agree that it is useful if we had the guarantee that file handles are unique in the way you describe. As it currently stands that doesn't seem to be the case and userspace doesn't seem to have a way of figuring out if the handle provided by name_to_handle_at() is indeed unique as you describe and can be reliably passed to open_by_handle_at(). Yes, we should fix it but that's really orthogonal to the mount id. It is separately useful and we already do expose it anyway.