From owner-freebsd-stable@FreeBSD.ORG Wed Jan 5 14:56:03 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A11DA1065674 for ; Wed, 5 Jan 2011 14:56:03 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 626248FC25 for ; Wed, 5 Jan 2011 14:56:02 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEAB8VJE2DaFvO/2dsb2JhbACDd6EdsQuNV4Ehgzd0BIRohiI X-IronPort-AV: E=Sophos;i="4.60,278,1291611600"; d="scan'208";a="105981700" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 05 Jan 2011 09:56:01 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 9DD60B40B0; Wed, 5 Jan 2011 09:56:01 -0500 (EST) Date: Wed, 5 Jan 2011 09:56:01 -0500 (EST) From: Rick Macklem To: Jean-Yves Avenard Message-ID: <1097353631.125552.1294239361572.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <641784536.120801.1294235832169.JavaMail.root@erie.cs.uoguelph.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.199] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE8 (Win)/6.0.10_GA_2692) Cc: Marek Salwerowicz , freebsd-stable@freebsd.org, Maciej Milewski Subject: Re: NFSv4 - how to set up at FreeBSD 8.1 ? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 14:56:03 -0000 > Yes, to access the file volumes via any version of NFS, they need to > be exported. (I don't think it would make sense to allow access to all > of the server's data without limitations for NFSv4?) > > What is different (and makes it confusing for folks familiar with > NFSv2,3) > is the fact that it is a single "mount tree" for NFSv4 that has to be > rooted > somewhere. > Solaris10 - always roots it at "/" but somehow works around the ZFS > case, > so any exported share can be mounted with the same path used > by NFSv2,3. > Linux - Last I looked (which was a couple of years ago), it exported a > single volume for NFSv4 and the rest of the server's volumes > could only be accessed via NFSv2,3. (I don't know if they've > changed this yet?) > > So, I chose to allow a little more flexibility than Solaris10 and > allow > /etc/exports to set the location of the "mount root". I didn't > anticipate > the "glitch" that ZFS introduced (where all ZFS volumes in the mount > path > must be exported for mount to work) because it does its own exporting. > (Obviously, the glitch/inconsistency needs to be resolved at some > point.) > Perhaps it would help to show what goes on the wire when a mount is done. # mount -t nfs -o nfsv4 server:/usr/home /mnt For NFSv2,3 there will be a Mount RPC with /usr/home as the argument. This goes directly to mountd and then mountd decides if it is ok and replies with the file handle (FH) for /usr/home if it is. For NFSv4, the client will do a compound RPC that looks something like this: (The exact structure is up to the client implementor.) PutRooFH <-- set the position to the "root mount location" as specified by the V4: line Lookup usr Lookup home GetFH <-- return the file handle at this location As such, there can only be one "root mount location" and at least Lookup operations must work for all elements of the path from there to the client's mount point. (For non-ZFS, it currently allows Lookup plus a couple of others that some clients use during mounting to work for non-exported file systems, so that setting "root mount location" == "/" works without exporting the entire file server's tree.) For all other operations, the file system must be exported just like for NFSv2,3. Hope this helps, rick