Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1929692pxy; Mon, 2 Aug 2021 14:11:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8KqVhuc/SXQpmASppTHEz0D5i9dHeDzZ0nS4i/L629zEFCRhhWl+zRcT8SdWeWM2lIUQm X-Received: by 2002:a6b:dc10:: with SMTP id s16mr1402613ioc.61.1627938668938; Mon, 02 Aug 2021 14:11:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627938668; cv=none; d=google.com; s=arc-20160816; b=KmWbE2Ad+fs+mp9LGj5IuAbrwppTG1eKz7Cal4j2aHb8XOqhJoQj3Nb80kU4q6GYzG v/UvyZax8uOPjmfImlzIdWcr7oiMa5iSsLAxWGi7ntF70J+UUCBaLO5MtqBX9E4DHGn+ cN8Hl/lqPZIHUuQmUm+ttManOxLEKbw5ontT/Os0TD6bh4yPETKs0D9wbKufOfmRV7U1 GvXpoNFyfuFOO5pFHy54yabf4WdEp96ASTyW3sNDoGCJRJnnour1WNU7rkP+uB39IOwb i0Da8qJXO+8+WxKv2VFwBnpubw7E6GOrmimr8YWExZGfxwEgijyOgdl5+GLM7L33nrj6 WtjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=dHZ2/Ll07WD3olUgwvKGtR6FEX0tCoDoGg2V3LwKtZ4=; b=zIWhrYptrdCfZlzvriirv4b9h3L4ljF3KVz+F/wHCUbSLenImLsQVEr7Oww89jTwYm 6eiAKdAANCSMF3c1wpted+G4wzYP6hBoLfOA4RFUIQkx2UcdSfsCqiEn9LwZNlPcufFp +3v5QFHqJb6Lzg3wdtvWrGCu0UbiwuBg4LoO4Qn94Y2vzHv1DVKXWZilskuteODRNbIt dNTXZJB2MPrYwDYOkQUIT6P70ReTcAanMZEcJ4WxbBRK8e5T4srOcFz8RSf4F4aRKmu7 AINgn1Eu3b/SueM/DKo0/COHsbdxHnh5VQTHee1HsYKLSn/6xV8jtZFeE4t6sxDpVyUC PynA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=QuVc1ErV; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 d2si12715067iow.58.2021.08.02.14.10.56; Mon, 02 Aug 2021 14:11:08 -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=@suse.de header.s=susede2_rsa header.b=QuVc1ErV; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 S231623AbhHBVLE (ORCPT + 99 others); Mon, 2 Aug 2021 17:11:04 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:33838 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231583AbhHBVLE (ORCPT ); Mon, 2 Aug 2021 17:11:04 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 44F992203F; Mon, 2 Aug 2021 21:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627938653; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dHZ2/Ll07WD3olUgwvKGtR6FEX0tCoDoGg2V3LwKtZ4=; b=QuVc1ErVArVvsHnPBQm4qXMVNWi/ZTPC9bdyQCgHp09Z1EfR952Er9s0kwx9RGJfNKvCpV L3A5qKOL+pK4WLoMTrzoiS5+yKzSZhkNxPXkbW6Au03AYJhYBW2wEJ8NmsqJVBerTHQ0+W h8rgDqOLpIQMWueNq0tsQGReCbtWNLQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627938653; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dHZ2/Ll07WD3olUgwvKGtR6FEX0tCoDoGg2V3LwKtZ4=; b=Ez8aOmzaReHigzMq1fV5mt18VOOJo3cgIoDe8RmzWoDHmKqUaXsKLVDcoM3Ger946oB5g3 D0bc8P4yhKn2gMBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1FCC413CAE; Mon, 2 Aug 2021 21:10:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id baPSM1lfCGGefwAAMHmgww (envelope-from ); Mon, 02 Aug 2021 21:10:49 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "J. Bruce Fields" 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. In-reply-to: <20210802123930.GA6890@fieldses.org> References: <162742539595.32498.13687924366155737575.stgit@noble.brown>, <162742546548.32498.10889023150565429936.stgit@noble.brown>, , <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> Date: Tue, 03 Aug 2021 07:10:44 +1000 Message-id: <162793864421.32159.6348977485257143426@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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. 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). NeilBrown