Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1950693pxy; Mon, 2 Aug 2021 14:51:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymVY3uOuD6IgZqTo8O0VV2ySw8YzmXqZrO6lFnLno2tgKn7uqyC9nFC/1yFoeUroBaDjwb X-Received: by 2002:a50:b412:: with SMTP id b18mr22090045edh.103.1627941098081; Mon, 02 Aug 2021 14:51:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627941098; cv=none; d=google.com; s=arc-20160816; b=Q3ipjzqNnwpFhGW5noeGJpC+viUgeEaSpss+J9P8fwUilsTPD4HJ+QtPNCNLk6mAyX LvZBu7w/HfGgISFyMahD6TFTd09XfmVjBfq8KvYe1qMZnxVmb5JQ+/hdOfTZHJGaN9TD qckYRGREL7W5FPZx/23Ln945QbVb4DPd6YVeq/BnyNz2gq7xHkARWrqpuCzTjmv7iZ1M H2dzhNKlo0CYPLprOprqiYa0gl+yveWnIvcmCOGY8pWSgJfsJdTUpxZoo2Kq3ptJvBSt SEOMcmK5oCDkIeBzmXuGkIitNFIRER3/jA7pqoYeVehRZyPh5cpygi7+xXAKZIZJWRfU ag9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=JaewEe5nYHdaegTZn8MI1wszSWIu0Ns2lco1QvC9POk=; b=LjME0lJFzUKtjhyFk8LZfLGQi526vQc3HsxkJF4Szj3sxQLxnrv5tKFkZhAMQUHERo vuqS1s5C4dZooIiDg6s4tf3sopr6dyH0uxv/FnDdytz0cp04/XgioUpnm7M55Hp68EdT fBGwaz3s/K1v3vYWxZBojN/5gi+nyD8MovzJbS3k19uVDqQCm+rya233PD6QTV0Zhdp4 GHziKhULDLMdFMiFjV5eLk9YunMGb/LSZHD//08QlVQ5KQKbPfM8hxS9zClpceLaPzBI nsTqm1HK0tmUxTXlke5PdguFN5+V+pwXF9w4vw2Qr55TDuXkgwNPv0wScn2d5O331oo3 mOmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=fLBq0mPN; 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 o5si11867902edc.478.2021.08.02.14.51.14; Mon, 02 Aug 2021 14:51:38 -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; dkim=pass header.i=@fieldses.org header.s=default header.b=fLBq0mPN; 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 S232532AbhHBVvL (ORCPT + 99 others); Mon, 2 Aug 2021 17:51:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231656AbhHBVvK (ORCPT ); Mon, 2 Aug 2021 17:51:10 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5E74C06175F; Mon, 2 Aug 2021 14:51:00 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 9FBA1620E; Mon, 2 Aug 2021 17:50:59 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 9FBA1620E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1627941059; bh=JaewEe5nYHdaegTZn8MI1wszSWIu0Ns2lco1QvC9POk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fLBq0mPNyu9VUAZJhlbQ66JaINar/UdLEhaom7yyAX0b45VbiFsCnq3vQC7EpwnF6 dgrQgYAGR+ixvij6wfvLnRpCchDGXFKUPh63dSVfq0g9AjZX2Amril5Jrstf8uT62G snfarl3E9dZjKGEkGfj8ze8bOT/E+YvdNMKlnoQw= Date: Mon, 2 Aug 2021 17:50:59 -0400 From: "J. Bruce Fields" To: NeilBrown Cc: Miklos Szeredi , Al Viro , Christoph Hellwig , Josef Bacik , Chuck Lever , Chris Mason , David Sterba , linux-fsdevel@vger.kernel.org, Linux NFS list , Btrfs BTRFS Subject: Re: A Third perspective on BTRFS nfsd subvol dev/inode number issues. Message-ID: <20210802215059.GF6890@fieldses.org> References: <162762290067.21659.4783063641244045179@noble.neil.brown.name> <162762562934.21659.18227858730706293633@noble.neil.brown.name> <162763043341.21659.15645923585962859662@noble.neil.brown.name> <162787790940.32159.14588617595952736785@noble.neil.brown.name> <20210802123930.GA6890@fieldses.org> <162793864421.32159.6348977485257143426@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <162793864421.32159.6348977485257143426@noble.neil.brown.name> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, Aug 03, 2021 at 07:10:44AM +1000, NeilBrown wrote: > On Mon, 02 Aug 2021, J. Bruce Fields wrote: > > On Mon, Aug 02, 2021 at 02:18:29PM +1000, NeilBrown wrote: > > > For btrfs, the "location" is root.objectid ++ file.objectid. I think > > > the inode should become (file.objectid ^ swab64(root.objectid)). This > > > will provide numbers that are unique until you get very large subvols, > > > and very many subvols. > > > > If you snapshot a filesystem, I'd expect, at least by default, that > > inodes in the snapshot to stay the same as in the snapshotted > > filesystem. > > As I said: we need to challenge and revise user-space (and meat-space) > expectations. The example that came to mind is people that export a snapshot, then replace it with an updated snapshot, and expect that to be transparent to clients. Our client will error out with ESTALE if it notices an inode number changed out from under it. I don't know if there are other such cases. It seems like surprising behavior to me, though. --b. > In btrfs, you DO NOT snapshot a FILESYSTEM. Rather, you effectively > create a 'reflink' for a subtree (only works on subtrees that have been > correctly created with the poorly named "btrfs subvolume" command). > > As with any reflink, the original has the same inode number that it did > before, the new version has a different inode number (though in current > BTRFS, half of the inode number is hidden from user-space, so it looks > like the inode number hasn't changed).