Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp860746pxb; Fri, 13 Aug 2021 07:57:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqFD0goA5sGz25cf8CQoCaPv5Wtq4IRXSkgn+xCWSawk28cuh3Fpmfgw+s/8x7aH9SfgKb X-Received: by 2002:a17:906:580c:: with SMTP id m12mr2938913ejq.32.1628866640936; Fri, 13 Aug 2021 07:57:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628866640; cv=none; d=google.com; s=arc-20160816; b=wwwdxo6u50amboVdCnSugTXJlaYoN4RdmYoFRbn3lFGzPGjuNY9OLxqDAKOsKAL/pd 3bkuD5SK0p009u+9em8WDY37Y6p8l0CsrAlJW2HE36mfPYgxAEhCEoNMKsjIQi2uPqT7 KEca3jHB+RbeusuIgAT9SDzusSWOIb1umrBQCzbKARns4riWelBPOUe2nC8iV5BV4IYd F/YEP17gHQHet9tv+R1FxSrv3L8pQQ774ucEQ86yCMb4zp66V/rLrSLLHku534ciqvYj 2NUpPgwRWZKB41kSvF8SuNMlVw5D/lAxO1uhofi04YwFG5pcZHJViUOudL6oNomaI1qz xQ6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Ord6dLO+z3tSqMluPoWbEXl83RV8BHZzW5vBO+d0n/Q=; b=LWPbJQuuXaBbK2Ql+Pw1Bu/3BgfEIUrUDbJINNMUU2TO76zBn18XSWchxx4iI4DXAW FqE2d/nVJlfayk7lXcondzd+dyQFNNqbrH8HrWVxsRKR6tnPHp8Llgli7Osapm+JHWc/ mKI6fxKe7Zc3vZnAl2cZIPGPVLSjWxclgqbvG1IOsLssB7YLsgk7S5OVEmcOk0ns4z+I djZKRrQ59XodPPstiseJgmQ+aURpsgNqPEg/CnT1n27lZnbgtVWbbvqPscLwtPYU++MZ QLwGNRl63xwj82hjARRxJ5uLTKcUmnx9tYJa8iBn36zJ/AGCBBEbY1tWoI/JTDTq3kjo VxgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=hgkSPbVd; 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 l15si1703762ejq.576.2021.08.13.07.56.54; Fri, 13 Aug 2021 07:57:20 -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=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=hgkSPbVd; 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 S240874AbhHMOzy (ORCPT + 99 others); Fri, 13 Aug 2021 10:55:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240862AbhHMOzx (ORCPT ); Fri, 13 Aug 2021 10:55:53 -0400 Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3A9DC0617AD for ; Fri, 13 Aug 2021 07:55:26 -0700 (PDT) Received: by mail-qt1-x82a.google.com with SMTP id r21so433302qtw.11 for ; Fri, 13 Aug 2021 07:55:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Ord6dLO+z3tSqMluPoWbEXl83RV8BHZzW5vBO+d0n/Q=; b=hgkSPbVdYXzvqli8P66Phz0CPr9SOyrnkiDQZlIalXmD+R4Tv6F4Q0mdTZ8ba/5gfw oW1EGDpsyyxofq3osqzZ0JTzPhDrpqZlP+vn8bYROr23Q+UBOPDDdnyWVVohWCxzq1hx bRkxlkTqNb8//cOL3t3dD52d/bzIZ0z4eWv3bMCJkpCRPRwOvahUZJeBavJL9uzVAzMq 15aM0SGYrjQ3iAfBA0zor5ytYemmWvJcLG8bvIENG1Nn7zn+fQLal6SGG4TMtX6/fCSd vkemQr4G5bYEe8mP8fIrGiXexmOMyZ2/KfQt8ph/u2OLc36usfiyMeRhtQupbr3eGVKV SJ0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Ord6dLO+z3tSqMluPoWbEXl83RV8BHZzW5vBO+d0n/Q=; b=atqtOFmb/FvIGBl7kMsKiDzVgk/zdlmzg7U4j/syWuiTJqTfPaHIVAE8tZ4LBWjcXz /NcpmFZgLVyU84i2KDFFLPUCempieZoQlnN7t47DBmdQyCCJnaCSYX/U81MGaiIHvn5L 9OmU2H66zHQQLCwVPbaY7PLW2uh9nOwgp8sTndhBpHgUQoGkhKnwB3eps0kDNbw5ZIgr tcZu0xQVV56dnAQYBQGXvJVhW7CzZOWqO1mNutMYL980kEisugaSX3/p3S5HT/+n4nGy xV5Uyd5p5K3T6eqn7DGaLloqvJ7cJIkmzoJEcvaFFnwlJSZPYtsP26AWV6v3ECzKFq/C 4Ssg== X-Gm-Message-State: AOAM532d8rhpaRSkyyqwOzWOs+wqCUq4tng+G7RiG4QTQVS/3uYu92Z9 5bt5axbXVlZb3r4ewCafiJXo6w== X-Received: by 2002:ac8:682:: with SMTP id f2mr2289567qth.55.1628866526046; Fri, 13 Aug 2021 07:55:26 -0700 (PDT) Received: from [192.168.1.45] (cpe-174-109-172-136.nc.res.rr.com. [174.109.172.136]) by smtp.gmail.com with ESMTPSA id o63sm1090299qkf.4.2021.08.13.07.55.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Aug 2021 07:55:25 -0700 (PDT) Subject: Re: [PATCH] VFS/BTRFS/NFSD: provide more unique inode number for btrfs export To: NeilBrown , Christoph Hellwig , "J. Bruce Fields" , Chuck Lever , Chris Mason , David Sterba , Alexander Viro Cc: linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-btrfs@vger.kernel.org References: <162742539595.32498.13687924366155737575.stgit@noble.brown> <162881913686.1695.12479588032010502384@noble.neil.brown.name> From: Josef Bacik Message-ID: Date: Fri, 13 Aug 2021 10:55:23 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <162881913686.1695.12479588032010502384@noble.neil.brown.name> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 8/12/21 9:45 PM, NeilBrown wrote: > > [[This patch is a minimal patch which addresses the current problems > with nfsd and btrfs, in a way which I think is most supportable, least > surprising, and least likely to impact any future attempts to more > completely fix the btrfs file-identify problem]] > > BTRFS does not provide unique inode numbers across a filesystem. > It *does* provide unique inode numbers with a subvolume and > uses synthetic device numbers for different subvolumes to ensure > uniqueness for device+inode. > > nfsd cannot use these varying device numbers. If nfsd were to > synthesise different stable filesystem ids to give to the client, that > would cause subvolumes to appear in the mount table on the client, even > though they don't appear in the mount table on the server. Also, NFSv3 > doesn't support changing the filesystem id without a new explicit > mount on the client (this is partially supported in practice, but > violates the protocol specification). > > So currently, the roots of all subvolumes report the same inode number > in the same filesystem to NFS clients and tools like 'find' notice that > a directory has the same identity as an ancestor, and so refuse to > enter that directory. > > This patch allows btrfs (or any filesystem) to provide a 64bit number > that can be xored with the inode number to make the number more unique. > Rather than the client being certain to see duplicates, with this patch > it is possible but extremely rare. > > The number than btrfs provides is a swab64() version of the subvolume > identifier. This has most entropy in the high bits (the low bits of the > subvolume identifer), while the inoe has most entropy in the low bits. > The result will always be unique within a subvolume, and will almost > always be unique across the filesystem. > This is a reasonable approach to me, solves the problem without being overly complicated and side-steps the thornier issues around how we deal with subvolumes. I'll leave it up to the other maintainers of the other fs'es to weigh in, but for me you can add Acked-by: Josef Bacik Thanks, Josef