Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp715499pxb; Wed, 1 Sep 2021 08:29:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnxBhhDo++PmiTDKZ9QZSZr7RBwzjdgjaDDySi/1Bt3qPZxCyIv3AmC9A9XvZJd+I1HhOU X-Received: by 2002:a17:906:f43:: with SMTP id h3mr38014540ejj.267.1630510139609; Wed, 01 Sep 2021 08:28:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630510139; cv=none; d=google.com; s=arc-20160816; b=v7eZTMIcdKOm2ix25FTs/SV0YhdQd8AVFsIjVTFOdS7SOdPdHySK5zNBhGuiyInNEn G4YGzE7AhenpPBpJx1nevk7xpFckxDLsHqJbo81SElKCUwxAQzTEQ+Nkh6It5cBnVbrC DTiwvBlNOAT0FAsBurZgIuwbCF6AqK+XnKeKeowziFhmV+/Jt0jQGgXsZiQ6xm1j7RYn u0m2Z44OF17DwObgRHvhK8aif/q4swhf3BRXY8eXDRDa+l3fYj1XVwHwIoSP6wQYSab6 Sw6CUjyqaKp/rKo7I+V8SHtMvesNXixbdPM5TY5MVjZQkEkyRXsncSVz7E5SGCiPSmiK dLzw== 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=o/wgkqf+HNM4jw0xc68wZiht+EdeCND2pgRsIXP1Y5g=; b=VZjwJCheTkFkeBfgUFM4ZswoTb0oXrSgQ3oMSYeTID4DG5+5UFqDEc1tj7bveHKaFo 5ONrpkUD4KRTxYWUd93Zj57t0Y7cjHvRAg1SgqHHBkLBU0St6BBId2m2D6F2jTUwR8x/ 6IoLyo4V0JiPv7E6Lu4MOag6TJSZi5VVwwHFsKf0EstlcI5lMKX/a+g0Tjz+ceTsaE1h fvcxS//3HLk4CpjKvsr129K1YwiUsweQs+OgPMrYrvEXImuDAFpVlxNrJjcpATL+4tOu dosqmvgfkCN0xvnIS+ZdU6yHAlQs3BZnEsHZMICG8WhUVwQ8bpqMblNhwLi3Ck1o36hk Q7QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=kdjRKPBo; 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 p7si47245ejf.317.2021.09.01.08.27.49; Wed, 01 Sep 2021 08:28:59 -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=kdjRKPBo; 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 S242530AbhIAPXu (ORCPT + 99 others); Wed, 1 Sep 2021 11:23:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233979AbhIAPXt (ORCPT ); Wed, 1 Sep 2021 11:23:49 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 136BBC061575; Wed, 1 Sep 2021 08:22:53 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id DE22E35BB; Wed, 1 Sep 2021 11:22:51 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org DE22E35BB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1630509771; bh=o/wgkqf+HNM4jw0xc68wZiht+EdeCND2pgRsIXP1Y5g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kdjRKPBogUMbLDVhrxt9qYx1CNpuiwFjoul4G11wtXpJ3/k5PsPURbp8/GF0vvtCk +XUY8Wn7uAwoJpE4dPS92EO2wcTMvX+IlsG3YQB6FLkOsQSJYxP+iOr6urSBizRbls zcQM7mGMlNdvVFkFMRZ2RsPzxNjiM9misvamhyDQ= Date: Wed, 1 Sep 2021 11:22:51 -0400 From: "J. Bruce Fields" To: Christoph Hellwig Cc: NeilBrown , Chuck Lever , linux-nfs@vger.kernel.org, Josef Bacik , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2] BTRFS/NFSD: provide more unique inode number for btrfs export Message-ID: <20210901152251.GA6533@fieldses.org> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Sep 01, 2021 at 08:20:06AM +0100, Christoph Hellwig wrote: > On Tue, Aug 31, 2021 at 02:59:05PM +1000, NeilBrown wrote: > > Making the change purely in btrfs is simply not possible. There is no > > way for btrfs to provide nfsd with a different inode number. To move > > the bulk of the change into btrfs code we would need - at the very least > > - some way for nfsd to provide the filehandle when requesting stat > > information. We would also need to provide a reference filehandle when > > requesting a dentry->filehandle conversion. Cluttering the > > export_operations like that just for btrfs doesn't seem like the right > > balance. I agree that cluttering kstat is not ideal, but it was a case > > of choosing the minimum change for the maximum effect. > > So you're papering over a btrfs bug by piling up cludges in the nsdd > code that has not business even knowing about this btrfs bug, while > leaving other users of inodes numbers and file handles broken? > > If you only care about file handles: this is what the export operations > are for. If you care about inode numbers: well, it is up to btrfs > to generate uniqueue inode numbers. It currently doesn't do that, and > no amount of papering over that in nfsd is going to fix the issue. > > If XORing a little more entropy It's stronger than "a little more entropy". We know enough about how the numbers being XOR'd grow to know that collisions are only going to happen in some extreme use cases. (If I understand correctly.) > into the inode number is a good enough band aid (and I strongly > disagree with that), do it inside btrfs for every place they report > the inode number. There is nothing NFS-specific about that. Neil tried something like that: https://lore.kernel.org/linux-nfs/162761259105.21659.4838403432058511846@noble.neil.brown.name/ "The patch below, which is just a proof-of-concept, changes btrfs to report a uniform st_dev, and different (64bit) st_ino in different subvols." (Though actually you're proposing keeping separate st_dev?) I looked back through a couple threads to try to understand why we couldn't do that (on new filesystems, with a mkfs option to choose new or old behavior) and still don't understand. But the threads are long. There are objections to a new mount option (which seem obviously wrong; this should be a persistent feature of the on-disk filesystem). --b.