Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp371957pxb; Wed, 1 Sep 2021 00:22:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1vv27DmBSLAwbu99S+C68uO+nrSUz6GzDVjydK6vh7ENBlrixI2hEbYG/3YWagISy9Tk8 X-Received: by 2002:a5d:9145:: with SMTP id y5mr4180571ioq.200.1630480935558; Wed, 01 Sep 2021 00:22:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630480935; cv=none; d=google.com; s=arc-20160816; b=UAA1Zw9xAH8EoetlDeoGGlIL8sScmeJOlKaz+FuX/QBoZQvvbMOHin+WvzwT6cxBtx u68BZgunJWr+md9w5bnr5DIk/BrCUIQGLiQFHiXidteYfJE1hX9lNVN8kqL4R1+GazdN akYKHX5qGk/lGxCvQKEkoO1QaHyK6h0Y206po6UBU76S1WnDnaLjltqmGsTpNWs9Uzda 9t44nrWEOdb0aDj+RMYh+Y8HRG3Wn+JgegwYPe70iq/jWJDTZU2W8duDDeCYq/5hWnGc ETCwJjVfpMv4h150xp5FTdTWYd89fxmlUdZqSFZEjLV25Xo1bkyRH2ZYnSEVNIL+9WOS xEtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lc17SoGeHMPTwzG9UqBo7b/uRedgJVdZcuMDmdo1GPY=; b=D/pQTKcWVrKWXOaWXG3NfRdGsRnpUB9tfZYLi6OXn6aJSXItiSFF24tOBnXX/Od3O3 0C27pk7H3yRfiL4Furrc/HEV8qBbNKKoC6ZByUV+N1X8/8q8W6HoE9AOuWhub5xzTznG HUcyPbBPW71DiHi1RJBQKWbwfnm8qqZv2BkrtULoRvll7Zrc3pZ3OwZpUz8dQEYDMqLJ 13uiUpHabO2PNq3tF15nDhpHJipvR7EamDirq2HfPhJ2gNhCfGUVGe+3Wqw2fzw8t1i1 54U220EvaOob5lJ7xAsTHYEBPnB19o39zJCbOgxCtw2kk9JnavPhr2q0W+edpox7DIAN CcaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=pjipg5Yv; 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 6si20001479ill.90.2021.09.01.00.21.49; Wed, 01 Sep 2021 00:22:15 -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=@infradead.org header.s=casper.20170209 header.b=pjipg5Yv; 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 S242567AbhIAHWU (ORCPT + 99 others); Wed, 1 Sep 2021 03:22:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242500AbhIAHWT (ORCPT ); Wed, 1 Sep 2021 03:22:19 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B8F0C061575; Wed, 1 Sep 2021 00:21:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=lc17SoGeHMPTwzG9UqBo7b/uRedgJVdZcuMDmdo1GPY=; b=pjipg5YvXPbY+yZUIhU9oHqA44 4MalxhjZ2SS+OKHxo2aveAICM9LTOcm4142w4c30rtCKyKG+A7owPY/VeQBvquBl/TfQ8ea9emyGn 7uwz/H8lJGKIP12pKgmO9th+8so2ZmcwPUUHev1N3walCATnee9iWznlRJfidW0+eva/Wbqy3SYyl RBVBoWhZyji+RNzdnM4ZTlFciO7qBZXxSxEhUr1GeSLvIXWj9GD2NGFSTVuy+Ssdp8nibATafXiqC EWBDphWlCKmAVQbDVx52kyq9DCmTYOMwqC5bgi3kJ2KBB11KrxT1zajcCZlIrwa1aMbQfRsf7PLDC zHOfWBdw==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLKXW-001z9l-Ul; Wed, 01 Sep 2021 07:20:18 +0000 Date: Wed, 1 Sep 2021 08:20:06 +0100 From: Christoph Hellwig To: NeilBrown Cc: Christoph Hellwig , "J. Bruce Fields" , 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: 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: <163038594541.7591.11109978693705593957@noble.neil.brown.name> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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 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.