Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5119981pxj; Tue, 22 Jun 2021 15:49:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkAhFGQbEjrFVwK6AdYjV70pfcLof0XSFF5PTv9+9sG6XfyJ98JVIL3YYt9VNp350Y2+al X-Received: by 2002:aa7:c1da:: with SMTP id d26mr8199644edp.278.1624402167629; Tue, 22 Jun 2021 15:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624402167; cv=none; d=google.com; s=arc-20160816; b=xwBPmUHPSt2mcbnM2Vu/bEIuD/oE6miorkK6Khz6lD09uHarKIedQE1inadwmI3Qkq d9HkoDO9CSGQiO+9nimPVnE93YgfaMO3L1EbEnJItUK9pzhHXhZuA7X/zefJVlGtUZRD nEerjP23Wgmgbljuqxv6sF/qKdW+dLK706ePO/baOHo2kWewO1xCl+2w/rZ/rLqAz/uO UK8j8jxGHJ0wnf+oqkgS22L1S4RjQfsoqaIBKTn8axIkrCsC6HnEWbOG1LWLVhwPjb53 Ea/pzdtnMEOjo7BsWn+fwEQJOLSsmbqPyPfwiw1POCqLvMiMx9LQEC1B2v82J3F/9g41 ZRPQ== 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=nORXqEJeLQ0B7RlNgz0Rpd9XrmVPNyemi0xOo+yiH9I=; b=HJ4VJ5ayANSmhZ5FjssCujE196eNWRf7K+N/mwvV/nmyAspbZKBgH6ngF6DMdR6KC1 2+TpvOBAEzJhm9QBHx5VpaUk1thMxAfA95Swl9dsff/xV2pOALUnMkfKfbhAuHARuEss EDYqMV5XkoqB1ZfFnpeMpOFVB9NHd1rG9jjI9oJsiVdBL5k3Jk3AppvtAqh6VqDwETnf cTGjKbX2qA2R0YwGwepL1P4/aoXu6yfqrlDLQkxRR71RsID1PNreqkEDPrQCsAT8ECgi 4LNfNh4DW9HBsxNbWR6jBEVNRwKIP7puPTgZCujdAnRRge2RhKM06+9CxZ0QP+8bzgMi 0q/A== 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 f14si13937931ejx.530.2021.06.22.15.48.49; Tue, 22 Jun 2021 15:49:27 -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 S230312AbhFVWu6 (ORCPT + 99 others); Tue, 22 Jun 2021 18:50:58 -0400 Received: from out20-49.mail.aliyun.com ([115.124.20.49]:56917 "EHLO out20-49.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbhFVWu6 (ORCPT ); Tue, 22 Jun 2021 18:50:58 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.04515028|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_regular_dialog|0.0139422-0.00183774-0.98422;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047212;MF=wangyugui@e16-tech.com;NM=1;PH=DS;RN=4;RT=4;SR=0;TI=SMTPD_---.KWS3tMs_1624402119; Received: from 192.168.2.112(mailfrom:wangyugui@e16-tech.com fp:SMTPD_---.KWS3tMs_1624402119) by smtp.aliyun-inc.com(10.147.41.187); Wed, 23 Jun 2021 06:48:40 +0800 Date: Wed, 23 Jun 2021 06:48:41 +0800 From: Wang Yugui To: Frank Filz Subject: Re: any idea about auto export multiple btrfs snapshots? Cc: Frank Filz , 'NeilBrown' , linux-nfs@vger.kernel.org In-Reply-To: References: <20210622064158.98CA.409509F4@e16-tech.com> Message-Id: <20210623064840.ABD8.409509F4@e16-tech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: 8bit X-Mailer: Becky! ver. 2.75.04 [en] Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi, > On 6/21/21 3:41 PM, Wang Yugui wrote: > > Hi, > > > >> OK thanks for the information. I think they will just work in nfs-ganesha as > >> long as the snapshots or subvols are mounted within an nfs-ganesha export or > >> are exported explicitly. nfs-ganesha has the equivalent of knfsd's > >> nohide/crossmnt options and when nfs-ganesha detects crossing a filesystem > >> boundary will lookup the filesystem via getmntend and listing btrfs subvols > >> and then expose that filesystem (via the fsid attribute) to the clients > >> where at least the Linux nfs client will detect a filesystem boundary and > >> create a new mount entry for it. > > > > Not only exported explicitly, but also kept in the same hierarchy. > > > > If we export > > /mnt/test #the btrfs > > /mnt/test/sub1 # the btrfs subvol 1 > > /mnt/test/sub2 # the btrfs subvol 2 > > > > we need to make sure we will not access '/mnt/test/sub1' through '/mnt/test' > > from nfs client. > > > > current safe export: > > #/mnt/test #the btrfs, not exported > > /mnt/test/sub1 # the btrfs subvol 1 > > /mnt/test/sub2 # the btrfs subvol 2 > > > > What's the problem with exporting /mnt/test AND then exporting sub1 and sub2 as crossmnt exports? As far as I can tell, that seems to work just fine with nfs-ganesha. I'm not sure what will happen on nfs-ganesha. crossmnt(kernel nfsd) failed to work when exporting /mnt/test,/mnt/test/sub1, /mnt/test/sub2. # /bin/find /nfs/test/ /nfs/test/ find: File system loop detected; ??/nfs/test/sub1?? is part of the same file system loop as ??/nfs/test/??. /nfs/test/.snapshot find: File system loop detected; ??/nfs/test/.snapshot/sub1-s1?? is part of the same file system loop as ??/nfs/test/??. find: File system loop detected; ??/nfs/test/.snapshot/sub2-s1?? is part of the same file system loop as ??/nfs/test/??. /nfs/test/dir1 /nfs/test/dir1/a.txt find: File system loop detected; ??/nfs/test/sub2?? is part of the same file system loop as ??/nfs/test/?? /bin/find report 'File system loop detected', it means that vfs cache( based on st_dev + st_ino?) on nfs client side will have some problem? In fact, I was exporting /mnt/test for years too. but btrfs subvols means multiple filesystems(different st_dev), in theory, we needs to use it based on nfs crossmnt. Best Regards Wang Yugui (wangyugui@e16-tech.com) 2021/06/23