From patchwork Tue Oct 2 05:24:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 1535681 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 22DFA3FDAE for ; Tue, 2 Oct 2012 05:25:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751317Ab2JBFYk (ORCPT ); Tue, 2 Oct 2012 01:24:40 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38259 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750753Ab2JBFYj (ORCPT ); Tue, 2 Oct 2012 01:24:39 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 1633C9D938; Tue, 2 Oct 2012 07:24:38 +0200 (CEST) Date: Tue, 2 Oct 2012 15:24:40 +1000 From: NeilBrown To: Chuck Lever Cc: NFS Subject: Re: Should "mount -o proto=udp" be usable against an IPv6 only server? Message-ID: <20121002152440.2e6a0c04@notabene.brown> In-Reply-To: References: <20120918115450.5c65973f@notabene.brown> <20120918162948.47840d42@notabene.brown> <20120919091904.624ee54b@notabene.brown> X-Mailer: Claws Mail 3.7.10 (GTK+ 2.24.7; x86_64-suse-linux-gnu) Mime-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, 18 Sep 2012 21:00:01 -0400 Chuck Lever wrote: > Out of interest, do you have a use case that could make positive use of a "please use UDP but I don't care whether its IPv4 or IPv6" setting? No, but that isn't really the point. The point is that to anyone not well verse in the lore of TI-RPC, "proto=udp" looks like it means "set the protocol to UDP", not "set the protocol to UDP and the protocol family to IPv4". One way to clear up the confusion would be to change the meaning of "proto=udp" to match what most people would epxect it to mean. The other it to document the non-obvious semantics thoroughly. I wanted to consider both options. > > +A > > +.I netid > > +determines both the > > +.I transport > > +and > > +.I network > > +protocols, so for example > > "determines both the protocol family and transport" are closer to how these terms are defined in netconfig(5), and I prefer that formulation. I still believe a citation of netconfig(5) would be correct and helpful. A citation in the SEE ALSO section should also be added. (SEE ALSO already mentions netconfig(5).) Don't you love standards.... ISO OSI seems to use "network" for layer 3 and "transport" for layer 4, which is where I got that names I used. netconfig(5) uses "protocol family" and "protocol" respectively, and "transport" to identify the combination of the two (which is also the network_id). socket(2) also uses "protocol family" and "protocol", but uses AF as the prefix for "protocol family" aka "address family" :-) This does serve to highlight the inappropriateness of using "proto=" to specify the "transport", and the netconfig usage treats the "protocol" as a just part of the "transport" (but allows e.g. "udp" to be both a protocol and a transport depending on context). It looks like "protocol" and "protocol family" are the most appropriate terms in the Unix world, and the examples can clear up any uncertainty: ------------ A .I netid determines both the .I protocol and .IR "protocol family" . So for example .B udp selects UDP over IPv4 while .B tcp6 selects TCP over IPv6. ----------------- > > As a matter of word smithing, I think starting a new sentence at "so for example" would be easier to read. Agreed. So how about this. Thanks, NeilBrown From: Neil Brown Date: Tue, 2 Oct 2012 15:21:46 +1000 Subject: [PATCH] mount.nfs mapage: clear up confusion between 'proto' and 'transport' The mount option "proto=" actually set the "transport" which in netconfig usage is the paring of a protocol (e.g. UDP, TCP) with a protocol family (e.g. INET, INET6). This can cause confusion if people naively except "proto=udp" to work equally well on IPv6. So add some text to both nfs(5) and nfsmount.conf(5) to hopefully clarify this. Signed-off-by: NeilBrown diff --git a/utils/mount/nfs.man b/utils/mount/nfs.man index da6d6d3..2741a60 100644 --- a/utils/mount/nfs.man +++ b/utils/mount/nfs.man @@ -1,5 +1,5 @@ .\"@(#)nfs.5" -.TH NFS 5 "2 November 2007" +.TH NFS 5 "19 September 2012" .SH NAME nfs \- fstab format and options for the .B nfs @@ -474,9 +474,17 @@ for NFS versions 2 and 3 only. .BI proto= netid The transport protocol name and protocol family the NFS client uses to transmit requests to the NFS server for this mount point. -If an NFS server has both an IPv4 and an IPv6 address, using a specific -netid will force the use of IPv4 or IPv6 networking to communicate -with that server. +A +.I netid +determines both the +.I protocol +and +.IR "protocol family" . +So for example +.B udp +selects UDP over IPv4 while +.B tcp6 +selects TCP over IPv6. .IP If support for TI-RPC is built into the .B mount.nfs @@ -775,9 +783,17 @@ for NFS version 4 and newer. .BI proto= netid The transport protocol name and protocol family the NFS client uses to transmit requests to the NFS server for this mount point. -If an NFS server has both an IPv4 and an IPv6 address, using a specific -netid will force the use of IPv4 or IPv6 networking to communicate -with that server. +A +.I netid +determines both the +.I transport +and +.I network +protocols, so for example +.B udp +selects UDP over IPv4 while +.B tcp6 +selects TCP over IPv6. .IP If support for TI-RPC is built into the .B mount.nfs @@ -851,6 +867,8 @@ The DATA AND METADATA COHERENCE section discusses the behavior of this option in more detail. .TP 1.5i .BI clientaddr= n.n.n.n +.TP 1.5i +.BI clientaddr= n:n: ... :n Specifies a single IPv4 address (in dotted-quad form), or a non-link-local IPv6 address, that the NFS client advertises to allow servers diff --git a/utils/mount/nfsmount.conf.man b/utils/mount/nfsmount.conf.man index 12a3fe7..2258296 100644 --- a/utils/mount/nfsmount.conf.man +++ b/utils/mount/nfsmount.conf.man @@ -1,5 +1,5 @@ .\"@(#)nfsmount.conf.5" -.TH NFSMOUNT.CONF 5 "9 Mar 2008" +.TH NFSMOUNT.CONF 5 "19 September 2012" .SH NAME nfsmount.conf - Configuration file for NFS mounts .SH SYNOPSIS @@ -18,6 +18,10 @@ to particular variables using the .BR = operator, as in .BR Proto=Tcp . +The variables that can be assigned are exactly the set of NFS specific +mount options listed in +.BR nfs (5). +.PP Sections are broken up into three basic categories: Global options, Server options and Mount Point options. .HP @@ -54,7 +58,7 @@ are defined in the configuration file. Proto=Tcp .RS .HP -The TCP protocol will be used on every NFS mount. +The TCP/IPv4 protocol will be used on every NFS mount. .HP .RE [ Server \(lqnfsserver.foo.com\(rq ] @@ -62,10 +66,13 @@ The TCP protocol will be used on every NFS mount. rsize=32k .br wsize=32k +.br + proto=udp6 .HP .RS -A 33k (32768 bytes) block size will be used as the read and write -size on all mounts to the 'nfsserver.foo.com' server. +A 32k (32768 bytes) block size will be used as the read and write +size on all mounts to the 'nfsserver.foo.com' server. UDP/IPv6 +is the protocol to be used. .HP .RE .BR