Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp1184660pxy; Sun, 15 Aug 2021 12:43:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydOLOhzagrZpwaHdpAQ/dshxxgyUWBvCQ6jFsVzOCojre4iKKLR1DEntRIFjx04ntTdsS/ X-Received: by 2002:aa7:d916:: with SMTP id a22mr15914475edr.158.1629056624468; Sun, 15 Aug 2021 12:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629056624; cv=none; d=google.com; s=arc-20160816; b=aFunr+6dwrvvIZYEMA3KFi2345U/W54QmK7BQ5QuPfQxNbfNGxK9yBr2y8aKdeMX/7 rY/a5p1ubnzy2MDr3ZcuLW7YQJtq3Ic1ugnyeBZ3L2GJW//vE7uK0jqCHEG2uEjTOfC4 9SpSEZiCSXyCBXXq6EXxgv3MVyXeP91KxwwJ225yzxqYHv2nYp2ECprLUkiKt1lrWk1K 4A1RDsPVE3VISlC4PY1yRdcfiZKgV3oq3SpRPN8Vo87eLg6OMAo/ITHAl770BCLgVTrh 1DTVhmrEpCRq2OGH48pRrJMXvPq5H6BwgWjGU039V0UexaKHIkJTUHjwL50b9g6nViwl DhXA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=HEKaaYR+PIER/+VeQFkLzl36g7Wu2LheSav+SzhlV00=; b=yw57yhWKVqd0mZUbMTMNdSkugnqkS1wVBCr8md8zg4kfkkoGiEHJODPL4L2yU0yo0n q1lDbe+YSdXyV36ggRh10KaOppeZBqjVeaT+LdzJDlKPajNyCSChjyjd7Xc5kkTUTPV6 38YNjzivBY6Fs5FRMFTXUUQV+OoS7LjaX1oz7gElmYpdHCqQMCp7BYBJ3eyoFSN5QBwd FmwtpmOm7VmCXBJr63KdIylI+eCIPrQzTspjuJpCiM17B5Ds4bttrG472HMINHglA2w4 cykFK8Mh7UhjIp1icMBH/1g+mkUoWct5CAsVJtAHNCx8byClgvZqDMaM5JUcK0Mj8kmK eoGw== 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 z23si8384354edx.139.2021.08.15.12.43.08; Sun, 15 Aug 2021 12:43:44 -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 S229603AbhHOTnW convert rfc822-to-8bit (ORCPT + 99 others); Sun, 15 Aug 2021 15:43:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229502AbhHOTnW (ORCPT ); Sun, 15 Aug 2021 15:43:22 -0400 X-Greylist: delayed 459 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 15 Aug 2021 12:42:51 PDT Received: from rin.romanrm.net (rin.romanrm.net [IPv6:2001:bc8:2dd2:1000::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1373C061764; Sun, 15 Aug 2021 12:42:51 -0700 (PDT) Received: from natsu (natsu2.home.romanrm.net [IPv6:fd39::e99e:8f1b:cfc9:ccb8]) by rin.romanrm.net (Postfix) with SMTP id 105091A0; Sun, 15 Aug 2021 19:35:05 +0000 (UTC) Date: Mon, 16 Aug 2021 00:35:05 +0500 From: Roman Mamedov To: Goffredo Baroncelli Cc: NeilBrown , Christoph Hellwig , Josef Bacik , "J. Bruce Fields" , Chuck Lever , Chris Mason , David Sterba , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: Re: [PATCH] VFS/BTRFS/NFSD: provide more unique inode number for btrfs export Message-ID: <20210816003505.7b3e9861@natsu> In-Reply-To: References: <162742539595.32498.13687924366155737575.stgit@noble.brown> <162881913686.1695.12479588032010502384@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Sun, 15 Aug 2021 09:39:08 +0200 Goffredo Baroncelli wrote: > I am sure that it was discussed already but I was unable to find any track > of this discussion. But if the problem is the collision between the inode > number of different subvolume in the nfd export, is it simpler if the export > is truncated to the subvolume boundary ? It would be more coherent with the > current behavior of vfs+nfsd. See this bugreport thread which started it all: https://www.spinics.net/lists/linux-btrfs/msg111172.html In there the reporting user replied that it is strongly not feasible for them to export each individual snapshot. > In fact in btrfs a subvolume is a complete filesystem, with an "own > synthetic" device. We could like or not this solution, but this solution is > the more aligned to the unix standard, where for each filesystem there is a > pair (device, inode-set). NFS (by default) avoids to cross the boundary > between the filesystems. So why in BTRFS this should be different ? From the user point of view subvolumes are basically directories; that they are "complete filesystems"* is merely a low-level implementation detail. * well except they are not, as you cannot 'dd' a subvolume to another blockdevice. > Why don't rename "ino_uniquifier" as "ino_and_subvolume" and leave to the > filesystem the work to combine the inode and the subvolume-id ? > > I am worried that the logic is split between the filesystem, which > synthesizes the ino_uniquifier, and to NFS which combine to the inode. I am > thinking that this combination is filesystem specific; for BTRFS is a simple > xor but for other filesystem may be a more complex operation, so leaving an > half in the filesystem and another half to the NFS seems to not optimal if > other filesystem needs to use ino_uniquifier. I wondered a bit myself, what are the downsides of just doing the uniquefication inside Btrfs, not leaving that to NFSD? I mean not even adding the extra stat field, just return the inode itself with that already applied. Surely cannot be any worse collision-wise, than different subvolumes straight up having the same inode numbers as right now? Or is it a performance concern, always doing more work, for something which only NFSD has needed so far. -- With respect, Roman