Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4083690pxv; Mon, 19 Jul 2021 16:27:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZceizzW7lZDfqbOZ8f2FtY0FaYglbciFLLeOE8uBEiPFJT/mYJ2H9b6yufS6lr1GH97qy X-Received: by 2002:a5d:87d0:: with SMTP id q16mr20736175ios.109.1626737257290; Mon, 19 Jul 2021 16:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626737257; cv=none; d=google.com; s=arc-20160816; b=FgYEWd/m/qrGVDdkWlsgg1CjA25ZgSJXA+dsc3LxjXb/xgGqfoNbKi3rC7D8wbe6HD L4513kEgWJ9y4iUYb4PxTkRhvD0BxC2CROEuBoX3f5Q5fIHNL1FYyNhii7NjLM6J0o2Q QAsbXAkSNrAw5xPwNc15Tij4O8wcgR4HZ6LsWZEID+xWsxVe0e7XcttQtGF6S9Y2VgwS yhHsVNP2cA1hYbWMkPl17JdBIc1n9RWFTgKsdaJhsXwVVyMM80Zz7RIRi1MI3WpHR5cI hdLUbi25SeZVy5r7dgJOxrSwJkNnVfRrtBaU6t3M+rnhtYjiQK4gv6NfjUx4Vhy7Rn1n 1VpQ== 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=b9qm4hKOOAHjad+oiXzxEcT+dT1CknWHrSBYAfAxuic=; b=SyQIhGuQqJsops+d28gLl25tXprsZq5wWloIyDQjCDC7//gQw2BlaGkQlfPul8q/kG /bQa444yifPv1cjvp1ghOQ98UAYewPgYGC18ZUUR9+Yjbht0r/MO65rc0jQLbTUFlW9k kOB6khr+Z1UGdpiEkkvepdXzbBwEQDa7WfUYZwA4zVqZV50GiGsStUJYBbE0LZOu1egw LDc5wlc9V0YsFeUgMlYPJzzJY8o0SFx3kFMBTw8cDHo06eXXVWwX7nnjNt/+VxappRK2 8majxbujXY2RnVxMrabqpqvuNIUO9tqH1izr8S7Cjw6jRktLQymsCZiAlWf+mlXDNwzh JKUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=J1SSzSUz; 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 y11si20606632jaf.84.2021.07.19.16.27.06; Mon, 19 Jul 2021 16:27:37 -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=J1SSzSUz; 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 S236504AbhGSWpx (ORCPT + 99 others); Mon, 19 Jul 2021 18:45:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358128AbhGSTTe (ORCPT ); Mon, 19 Jul 2021 15:19:34 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D31D3C061574; Mon, 19 Jul 2021 12:54:00 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 8EE5161D7; Mon, 19 Jul 2021 16:00:03 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 8EE5161D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1626724803; bh=b9qm4hKOOAHjad+oiXzxEcT+dT1CknWHrSBYAfAxuic=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=J1SSzSUzI9styPoMp40SP4m4ZHLIfWaV5z0IFTOz+2vpWnsE5PEhDXFEMw4IYsv6a dfRcxkoku2k7Pb5VS74LQDmC4HrIsSZWxMeOv41hb8Az7/4A1Q6MK9fKvwShPKOQ77 HcRfi0sroeqwC19rSOzdECIWkbDOVEodwkCoukSY= Date: Mon, 19 Jul 2021 16:00:03 -0400 From: "J. Bruce Fields" To: Josef Bacik Cc: NeilBrown , Christoph Hellwig , Chuck Lever , Chris Mason , David Sterba , linux-nfs@vger.kernel.org, Wang Yugui , Ulli Horlacher , linux-btrfs@vger.kernel.org Subject: Re: [PATCH/RFC] NFSD: handle BTRFS subvolumes better. Message-ID: <20210719200003.GA32471@fieldses.org> References: <20210613115313.BC59.409509F4@e16-tech.com> <20210310074620.GA2158@tik.uni-stuttgart.de> <162632387205.13764.6196748476850020429@noble.neil.brown.name> <28bb883d-8d14-f11a-b37f-d8e71118f87f@toxicpanda.com> <162638862766.13764.8566962032225976326@noble.neil.brown.name> <15d0f450-cae5-22bc-eef3-8a973e6dda27@toxicpanda.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15d0f450-cae5-22bc-eef3-8a973e6dda27@toxicpanda.com> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Jul 19, 2021 at 11:40:28AM -0400, Josef Bacik wrote: > Ok so setting aside btrfs for the moment, how does NFS deal with > exporting a directory that has multiple other file systems under > that tree? I assume the same sort of problem doesn't occur, but why > is that? Is it because it's a different vfsmount/sb or is there > some other magic making this work? Thanks, There are two main ways an NFS client can look up a file: by name or by filehandle. The former's the normal filesystem directory lookup that we're used to. If the name refers to a mountpoint, the server can cross into the mounted filesystem like anyone else. It's the lookup by filehandle that's interesting. Typically the filehandle includes a UUID and an inode number. The server looks up the UUID with some help from mountd, and that gives a superblock that nfsd can use for the inode lookup. As Neil says, mountd does that basically by searching among mounted filesystems for one with that uuid. So if you wanted to be able to handle a uuid for a filesystem that's not even mounted yet, you'd need some new mechanism to look up such uuids. That's something we don't currently support but that we'd need to support if BTRFS subvolumes were automounted. (And it might have other uses as well.) But I'm not entirely sure if that answers your question.... --b.