Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1465772pxy; Mon, 2 Aug 2021 02:12:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv0P+GzYdhtQTNfwlTjRJMCbY1szULHNiCwwB+zchluk5YLUkn2qvsIt/ymhYnlyLHZAKV X-Received: by 2002:a05:6402:361:: with SMTP id s1mr17823765edw.172.1627895572177; Mon, 02 Aug 2021 02:12:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627895572; cv=none; d=google.com; s=arc-20160816; b=zs00eN6auGqvPChw7nw5P3gNksxTmCb9Q9gKdKx/0zovv/6WzFEWqw66o7sxDaP8jc NxGs7K1edbICXlkjdXkNPybLPn478XoYdRqKsQDYHNYcP2av6eYTYABtqH65erB0qIma Xol/kMQdIyEYrWA4QRTcagLevmZslSokNFvRcYBc76L4O+As2UcPe9/nK/rgp0W8w/5w XtI7EQwBwAvyMhjzGI6WchLWN2EXnyD4rIYszmwE1/2XE+Hun7ntcD6eWLE01LizqNBC zx/hxDgCg4YdV6w6ZuF6/mDSazi5h8iEYT/5i8fHP8J+C2IFc40tbvFMZe4wMgqSoVmP +AfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:subject :message-id:cc:to:from:date; bh=u/xMt8zn6C9yJhZhQDCnkau9+7SA8dbeK270rAgjrq8=; b=zj09XPuv+FBL1p+LP+tg45RfMztvgatX00X8GdANc/6hw4Gb6rp9VKRYcCsMF0gFyA QzcuSQXX9xIM9tXFoDb4aNjeOjgaic+bSOXj27Nqp4HgS+zcLB24UsRT3ud1kfAx0xA7 SsegZatcYK1/mxXuqp6wmHDhpTCGaQJix2DFmLHVMXyKZbjqTAV2MxoP9OX2tdr59W2j eAel3VkQVvdhwuh/6XKFl+cM0ClDHtxDGOAfAptE24wsWGB/ku2RH1988enDmul+NiJm OXdxb/gZSmU+mLDUVpSqm9v+9aotxKp0w5YqYilBG55p1Q/euHA3In+lH8/ZgwV/XZGy BptQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u23si9349215edq.527.2021.08.02.02.12.20; Mon, 02 Aug 2021 02:12:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232776AbhHBJL3 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 2 Aug 2021 05:11:29 -0400 Received: from ste-pvt-msa2.bahnhof.se ([213.80.101.71]:31726 "EHLO ste-pvt-msa2.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232878AbhHBJL2 (ORCPT ); Mon, 2 Aug 2021 05:11:28 -0400 Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTP id E07893F6CC; Mon, 2 Aug 2021 11:11:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Flag: NO X-Spam-Score: -1.899 X-Spam-Level: X-Spam-Status: No, score=-1.899 tagged_above=-999 required=6.31 tests=[BAYES_00=-1.9, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no Received: from ste-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (ste-ftg-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Cy0qVDvQK-Ic; Mon, 2 Aug 2021 11:11:16 +0200 (CEST) Received: by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id 1CDAC3F4E5; Mon, 2 Aug 2021 11:11:14 +0200 (CEST) Received: from [192.168.0.126] (port=33408) by tnonline.net with esmtpsa (TLS1.3) tls TLS_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1mATyc-0000KC-Rr; Mon, 02 Aug 2021 11:11:13 +0200 Date: Mon, 2 Aug 2021 11:11:13 +0200 (GMT+02:00) From: Forza To: Amir Goldstein , NeilBrown Cc: Al Viro , Miklos Szeredi , Christoph Hellwig , Josef Bacik , "J. Bruce Fields" , Chuck Lever , Chris Mason , David Sterba , linux-fsdevel , Linux NFS list , Btrfs BTRFS Message-ID: <697c3b9.eed85c8a.17b0621a43a@tnonline.net> Subject: Re: A Third perspective on BTRFS nfsd subvol dev/inode number issues. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT X-Mailer: R2Mail2 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org ---- From: Amir Goldstein -- Sent: 2021-08-02 - 09:54 ---- > On Mon, Aug 2, 2021 at 8:41 AM NeilBrown wrote: >> >> On Mon, 02 Aug 2021, Al Viro wrote: >> > On Mon, Aug 02, 2021 at 02:18:29PM +1000, NeilBrown wrote: >> > >> > > It think we need to bite-the-bullet and decide that 64bits is not >> > > enough, and in fact no number of bits will ever be enough. overlayfs >> > > makes this clear. >> > >> > Sure - let's go for broke and use XML. Oh, wait - it's 8 months too >> > early... >> > >> > > So I think we need to strongly encourage user-space to start using >> > > name_to_handle_at() whenever there is a need to test if two things are >> > > the same. >> > >> > ... and forgetting the inconvenient facts, such as that two different >> > fhandles may correspond to the same object. >> >> Can they? They certainly can if the "connectable" flag is passed. >> name_to_handle_at() cannot set that flag. >> nfsd can, so using name_to_handle_at() on an NFS filesystem isn't quite >> perfect. However it is the best that can be done over NFS. >> >> Or is there some other situation where two different filehandles can be >> reported for the same inode? >> >> Do you have a better suggestion? >> > > Neil, > > I think the plan of "changing the world" is not very realistic. > Sure, *some* tools can be changed, but all of them? > > I went back to read your initial cover letter to understand the > problem and what I mostly found there was that the view of > /proc/x/mountinfo was hiding information that is important for > some tools to understand what is going on with btrfs subvols. > > Well I am not a UNIX history expert, but I suppose that > /proc/PID/mountinfo was created because /proc/mounts and > /proc/PID/mounts no longer provided tool with all the information > about Linux mounts. > > Maybe it's time for a new interface to query the more advanced > sb/mount topology? fsinfo() maybe? With mount2 compatible API for > traversing mounts that is not limited to reporting all entries inside > a single page. I suppose we could go for some hierarchical view > under /proc/PID/mounttree. I don't know - new API is hard. > > In any case, instead of changing st_dev and st_ino or changing the > world to work with file handles, why not add inode generation (and > maybe subvol id) to statx(). > filesystem that care enough will provide this information and tools that > care enough will use it. > > Thanks, > Amir. I think it would be better and easier if nfs provided clients with virtual inodes and kept an internal mapping to actual filesystem inodes. Samba does this with the mount.cifs -o noserverino option, and as far as I know it works pretty well. This could be made either as an export option (/mnt/foo *(noserverino) or like in the Samba case, a mount option. This way existing tools will continue to work and we don't have to reinvent various Linux subsystems. Because it's an option, users that don't use btrfs or other filesystems with snapshots, can simply skip it. Thanks, Forza