Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1676934pxb; Mon, 13 Sep 2021 03:05:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzBhiokOZ8k0106PAHpwTJ7KCP90gB8/MAqwi9Axryir6g2Lz0DlkVL9slWZ8T35TNejTN X-Received: by 2002:a05:6e02:1a28:: with SMTP id g8mr4085506ile.158.1631527504978; Mon, 13 Sep 2021 03:05:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631527504; cv=none; d=google.com; s=arc-20160816; b=VPWSVjlJI4M05Nk39JWdC0lhsnWYfSmtXjNhyVdU2lC9dKHwHqTc0b2gZ0I8Pp/vqO ILbMDbaFMD/FV3CzsHNuIjUBApfqGkMalyujUL4zFUVbnh+Lvv71d0P4Zqd9UT46Qe50 skat15kawk7zcBzBtMPcwpQcS6GfCxn73CF914N1dEtdZLwTuq7RKDzwEgTk+IWZcfOy b/94XLQgRrWk7IPuwTR2vk7D9oFcbu/SHhkgn+/KDChVuVP584NNfQdem3M1QUR78ftl VjFqq9G1hqnnf/Fn4EWuuetS+GQqtiExsoQiwX2320b772uklXwTtl9zig6WqaIHDylL kiDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MHsA16MmTwJ7m8LQOCBFaJxQ81vKONAL+/tGmbsbP/M=; b=VpRcN/ROoyYPb3DWalDD236UaFe4R0qkvHpu+nB1P2fBDlGuRSVeVyv4gWVfh+5Ubz 0aynjjqUjA6SgNOVcNv0TdqTh3hAg+ps8k1FF0AWjBTP4kqTxPqjWGpYyFvi6RvQhqGY MCPtN5mcvR1AHJxFi3y6sDOOyAVAuihvzlXm59bPM349G2thZVrQWeOmOBIKYiWGIP9i EfFeIPzgbcy1Sd1GfCuuAn1aPeRGbQ5Zxo7pTfRSQ1R7fpeQ05JJphBd04ySoIcUvYbD Y8wnaMQgdfKjJulgr9QYaigc6WAZmuPlMlFv7Z+6Ax327U1Td8KT6p0lySHE0LwAa+9k BadA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=E1Y5AC0m; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i20si6553061ilj.3.2021.09.13.03.04.42; Mon, 13 Sep 2021 03:05:04 -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=@gmail.com header.s=20210112 header.b=E1Y5AC0m; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238444AbhIMKFd (ORCPT + 99 others); Mon, 13 Sep 2021 06:05:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238362AbhIMKFd (ORCPT ); Mon, 13 Sep 2021 06:05:33 -0400 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7C49C061574; Mon, 13 Sep 2021 03:04:17 -0700 (PDT) Received: by mail-il1-x12b.google.com with SMTP id l10so9410200ilh.8; Mon, 13 Sep 2021 03:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MHsA16MmTwJ7m8LQOCBFaJxQ81vKONAL+/tGmbsbP/M=; b=E1Y5AC0mIBlR3kybukkKzCWOhn6aIaU0tuU21P/lDrkFMHKuxdzbPn4E7dpGtvvE++ 9+MPyhBzlK/IqBtF5auZUF/CfVUDIIBrdnTyzfVm8tHepA1o3ahoOusVIrjGERnvVv89 jF/x0ouN4WOgxJBOxfcrJWQ7DHp7L51rqgqbcLC/BRgo3LI+hYGcEtY5J9opmPY9fmIl BjVStfB/R7ET91nGx+McauU/rgh3TOLgUVbHdvA4S5soo9H61ZA8ouHEdDeKhsuBl7s/ nQGjTkJhL6bwbjiqwGIFekoYYTIUBpCHkAq54ZbMyCvCxizRBPFCHfkhzidrpm9sUGwx fXcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MHsA16MmTwJ7m8LQOCBFaJxQ81vKONAL+/tGmbsbP/M=; b=mhGlDH76G0Z6BWXDvQWw3WCzWzVTmxmgsywpmW+Y6z5Y6PVFtsMmOo0yMmUnRP8FhR 11PY1gRJJ4WgQ1Xv1JJ5cqSDXQq+B0AFOGmZcTvYShFmLOm/EE2xic90VQ65ofhY/mTN VzBIZfM85g1CKyuj+vaNVKPsIOBjlIDZ92HPD2eJGQHUQbveun7oOLdfQmfayKlHrwJE wHVobn7y1BddAFB8EpeTumsTlcUnYloxqisxD6XJpv1ivRGWkUUSTfPccuvN8eZW9aF1 e1HR603QXFaSrUD8KGqxoy3b0LB3Eb4MkTmZZlnw7aMeefrNz+yE1/QZ3/UzhPM0nd0P kLUQ== X-Gm-Message-State: AOAM532qrQy1vMeIZM7/s0VXQCM8UZnvFyDAmraZvWbqdZscEDAWGd4W 5zsQgp6rHZrWGC0qtpUz0fUjMqE/JKB1Pqj/rHOSUZO5TlQ= X-Received: by 2002:a92:d752:: with SMTP id e18mr7725996ilq.254.1631527457350; Mon, 13 Sep 2021 03:04:17 -0700 (PDT) MIME-Version: 1.0 References: <162995209561.7591.4202079352301963089@noble.neil.brown.name> <162995778427.7591.11743795294299207756@noble.neil.brown.name> <163010550851.7591.9342822614202739406@noble.neil.brown.name> <163038594541.7591.11109978693705593957@noble.neil.brown.name> <20210901152251.GA6533@fieldses.org> <163055605714.24419.381470460827658370@noble.neil.brown.name> <20210905160719.GA20887@fieldses.org> <163089177281.15583.1479086104083425773@noble.neil.brown.name> <163149382437.8417.3479990258042844514@noble.neil.brown.name> In-Reply-To: <163149382437.8417.3479990258042844514@noble.neil.brown.name> From: Amir Goldstein Date: Mon, 13 Sep 2021 13:04:05 +0300 Message-ID: Subject: Re: [PATCH v2] BTRFS/NFSD: provide more unique inode number for btrfs export To: NeilBrown Cc: "J. Bruce Fields" , Christoph Hellwig , Chuck Lever , Linux NFS Mailing List , Josef Bacik , linux-fsdevel , Theodore Tso , Jan Kara Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org > > I do have one general question about the expected behavior - > > In his comment to the LWN article [2], Josef writes: > > > > "The st_dev thing is unfortunate, but again is the result of a lack of > > interfaces. > > Very early on we had problems with rsync wandering into snapshots and > > copying loads of stuff. Find as well would get tripped up. > > The way these tools figure out if they've wandered into another file system > > is if the st_dev is different..." > > > > If your plan goes through to export the main btrfs filesystem and > > subvolumes as a uniform st_dev namespace to the NFS client, > > what's to stop those old issues from remerging on NFS exported btrfs? > > That comment from Josef was interesting.... It doesn't align with > Commit 3394e1607eaf ("Btrfs: Give each subvol and snapshot their own anonymous devid") > when Chris Mason introduced the per-subvol device number with the > justification that: > Each subvolume has its own private inode number space, and so we need > to fill in different device numbers for each subvolume to avoid confusing > applications. > > But I understand that history can be messy and maybe there were several > justifications of which Josef remembers one and Chris reported > another. > I don't see a contradiction between the two reasons. Reporting two different objects with the same st_ino;st_dev is a problem and so is rsync wandering into subvolumes is another problem. Separate st_dev solves the first problem and leaves the behavior or rsync in the hands of the user (i.e. rsync --one-file-system). > If rsync did, in fact, wander into subvols and didn't get put off by the > duplicate inode numbers (like 'find' does), then it would still do that > when accessing btrfs over NFS. This has always been the case. Chris' > "fix" only affected local access, it didn't change NFS access at all. > Right, so the right fix IMO would be to provide similar semantics to the NFS client, like your first patch set tried to do. > > > > IOW, the user experience you are trying to solve is inability of 'find' > > to traverse the unified btrfs namespace, but Josef's comment indicates > > that some users were explicitly unhappy from 'find' trying to traverse > > into subvolumes to begin with. > > I believe that even 12 years ago, find would have complained if it saw a > directory with the same inode as an ancestor. Chris's fix wouldn't > prevent find from entering in that case, because it wouldn't enter > anyway. > > > > > So is there really a globally expected user experience? > > No. Everybody wants what they want. There is some overlap, not no > guarantees. That is the unavoidable consequence of ignoring standards > when implementing functionality. > > > If not, then I really don't see how an nfs export option can be avoided. > > And I really don't see how an nfs export option would help... Different > people within and organisation and using the same export might have > different expectations. That's true. But if admin decides to export a specific btrfs mount as a non-unified filesystem, then NFS clients can decide whether ot not to auto-mount the exported subvolumes and different users on the client machine can decide if they want to rsync or rsync --one-file-system, just as they would with local btrfs. And maybe I am wrong, but I don't see how the decision on whether to export a non-unified btrfs can be made a btrfs option or a nfsd global option, that's why I ended up with export option. Thanks, Amir.