Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3848878pxj; Mon, 21 Jun 2021 07:56:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxY0y0uESYCc3KyHH+0WS7s899esuFEvhOioN2fcMSN4cVisBZwd4yHQ0QE/68Yte2DhHy X-Received: by 2002:a17:907:728d:: with SMTP id dt13mr11736552ejc.390.1624287402843; Mon, 21 Jun 2021 07:56:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624287402; cv=none; d=google.com; s=arc-20160816; b=w0wttg3ax+bkS8fiusBt2Wk2PTcg/f68TpFw1G0cyNIL8pM+v1qVkTnM5dGeKReyHm N9kUEBX1sFYdChDo6wbX/NEK6KVxSP/LYNT2ub4seqVqT2zE4rxjDHILbfS78o6swT2M 1SkxiZ4okcxfqFrVTFJiFqBu1md7zyvIqBA1H9rkUAQZ1usbHEbPv22WLTN7Vza82J9y aFNWthoFc94jvwwiSHIoYEr2UPYcQJ3zIpZx3OKSk4g2EpM+fcb5Vz0PSH++i1Cjqlnr 8qQpcrqQHc0rDoj3TxcXFzVnSS1OBH6dyzIvn5S0Iz48QMc9NY3oAHEq/1kjlr4AuQHU wFEg== 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 :message-id:references:in-reply-to:cc:subject:to:from:date; bh=30UVwxfK8hNR+LNlb4OoShLAUFg8KvKhi5FRpJVSrcI=; b=JDI4QD8Bb2qX2pf4OVgsoR05H423urFNA5QzroCrIoBPPSlhINCSw9DtXWzlTkqUYP 5Gu9OBgO69x/cN1IN5kd/6xWUcnGwjEd0Xm/stuznRt5lJ5xjQoCeHKF5rR285F19BBT 8WEhJggDD5/qDuagMnNlzBaHcVx6UoIlCwGcV7ldyn/88x2nEnD88jIRdd+NRBKhY8Mw kQhuCEVGM2RYQW90VvACaeyufRXTz42hkoGP8j8DWcq88ycWgBNq/ksCEYafhsVNufqY BdjG+gmoojmJKRk7rXJiVZMGvAJ6+DNExczxoXs0OAfbHZdh8kBM2m8WYbKJhhNeLR2Q iObw== 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 dn1si16652480edb.105.2021.06.21.07.56.14; Mon, 21 Jun 2021 07:56:42 -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 S230047AbhFUO57 (ORCPT + 99 others); Mon, 21 Jun 2021 10:57:59 -0400 Received: from out20-61.mail.aliyun.com ([115.124.20.61]:37786 "EHLO out20-61.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230061AbhFUO57 (ORCPT ); Mon, 21 Jun 2021 10:57:59 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07265381|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_regular_dialog|0.20121-0.00778115-0.791009;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047193;MF=wangyugui@e16-tech.com;NM=1;PH=DS;RN=3;RT=3;SR=0;TI=SMTPD_---.KVltmq8_1624287340; Received: from 192.168.2.112(mailfrom:wangyugui@e16-tech.com fp:SMTPD_---.KVltmq8_1624287340) by smtp.aliyun-inc.com(10.147.42.135); Mon, 21 Jun 2021 22:55:41 +0800 Date: Mon, 21 Jun 2021 22:55:41 +0800 From: Wang Yugui To: "Frank Filz" Subject: Re: any idea about auto export multiple btrfs snapshots? Cc: "'NeilBrown'" , In-Reply-To: <000001d766aa$a16b3470$e4419d50$@mindspring.com> References: <162425113589.17441.4163890972298681569@noble.neil.brown.name> <000001d766aa$a16b3470$e4419d50$@mindspring.com> Message-Id: <20210621225541.3CEB.409509F4@e16-tech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.75.04 [en] Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi, > > I think the problem is that the submount doesn't appear in /proc/mounts. > > "nfsd_fh()" in nfs-utils needs to be able to map from the uuid for a filesystem to > > the mount point. To do this it walks through /proc/mounts checking the uuid of > > each filesystem. If a filesystem isn't listed there, it obviously fails. > > > > I guess you could add code to nfs-utils to do whatever "btrfs subvol list" does to > > make up for the fact that btrfs doesn't register in /proc/mounts. > > > > NeilBrown > > I've been watching this with interest for the nfs-ganesha project. We recently were made aware that we weren't working with btrfs subvols, and I added code so that in addition to using getmntent (essentially /proc/mounts) to populate filesystems, we also scan for btrfs subvols and with that we are able to export subvols. My question is does a snapshot look any different than a subvol? If they show up in the subvol list then we shouldn't need to do anything more for nfs-ganesha, but if there's something else needed to discover them, then we may need additional code in nfs-ganesha. I have not yet had a chance to check out exporting a snapshot yet. > My question is does a snapshot look any different than a subvol? No difference between btrfs subvol and snapshot in theory. but the btrfs subvol number in product env is usually fixed, and the btrfs snapshot number is usually dynamic. For fixed-number btrfs subvol/snapshot, it is OK to put them in the same hierarchy, and then export all in /etc/exports static, as a walk around. For dynamic-number btrfs snapshot number, we needs a dynamic way to export them in nfs. Best Regards Wang Yugui (wangyugui@e16-tech.com) 2021/06/21