* [PATCH 19/27] NFS: Ensure that NFS version 4 mounts use NFS_PORT if nfsport wasn't set @ 2007-10-26 17:32 Chuck Lever 2007-10-29 14:59 ` Talpey, Thomas 0 siblings, 1 reply; 3+ messages in thread From: Chuck Lever @ 2007-10-26 17:32 UTC (permalink / raw) To: trond.myklebust; +Cc: nfs Text-based mount option parsing introduced a minor regression in the behavior of NFS version 4 mounts. NFS version 4 is not supposed to require a running rpcbind service on the server in order for a mount to succeed. In other words, if the mount options don't specify a port number, the port number is supposed to default to 2049. For earlier versions of NFS, the default port number was zero in order to cause the RPC client to autobind to the server's NFS service. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> --- fs/nfs/super.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index fa517ae..1b2fac8 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -1612,6 +1612,8 @@ static int nfs4_validate_mount_data(void *options, if (nfs_parse_mount_options((char *)options, args) == 0) return -EINVAL; + if (args->nfs_server.address.sin_port == 0) + args->nfs_server.address.sin_port = htons(NFS_PORT); if (!nfs_verify_server_address((struct sockaddr *) &args->nfs_server.address)) return -EINVAL; ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 19/27] NFS: Ensure that NFS version 4 mounts use NFS_PORT if nfsport wasn't set 2007-10-26 17:32 [PATCH 19/27] NFS: Ensure that NFS version 4 mounts use NFS_PORT if nfsport wasn't set Chuck Lever @ 2007-10-29 14:59 ` Talpey, Thomas 2007-10-29 16:08 ` Chuck Lever 0 siblings, 1 reply; 3+ messages in thread From: Talpey, Thomas @ 2007-10-29 14:59 UTC (permalink / raw) To: Chuck Lever; +Cc: nfs But... 2049 is only valid for TCP. Ther eis no such guarantee for RDMA, SCTP, etc etc. Wouldn't it be safer/better to fail the mount if no port is specified? This is what rpcbind would do if it fails to resolve the port, for example. Tom. At 01:32 PM 10/26/2007, Chuck Lever wrote: >Text-based mount option parsing introduced a minor regression in the >behavior of NFS version 4 mounts. NFS version 4 is not supposed to require >a running rpcbind service on the server in order for a mount to succeed. > >In other words, if the mount options don't specify a port number, the port >number is supposed to default to 2049. For earlier versions of NFS, the >default port number was zero in order to cause the RPC client to autobind >to the server's NFS service. > >Signed-off-by: Chuck Lever <chuck.lever@oracle.com> >--- > > fs/nfs/super.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > >diff --git a/fs/nfs/super.c b/fs/nfs/super.c >index fa517ae..1b2fac8 100644 >--- a/fs/nfs/super.c >+++ b/fs/nfs/super.c >@@ -1612,6 +1612,8 @@ static int nfs4_validate_mount_data(void *options, > if (nfs_parse_mount_options((char *)options, args) == 0) > return -EINVAL; > >+ if (args->nfs_server.address.sin_port == 0) >+ args->nfs_server.address.sin_port = htons(NFS_PORT); > if (!nfs_verify_server_address((struct sockaddr *) > &args->nfs_server.address)) > return -EINVAL; > > >------------------------------------------------------------------------- >This SF.net email is sponsored by: Splunk Inc. >Still grepping through log files to find problems? Stop. >Now Search log events and configuration files using AJAX and a browser. >Download your FREE copy of Splunk now >> http://get.splunk.com/ >_______________________________________________ >NFS maillist - NFS@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/nfs ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 19/27] NFS: Ensure that NFS version 4 mounts use NFS_PORT if nfsport wasn't set 2007-10-29 14:59 ` Talpey, Thomas @ 2007-10-29 16:08 ` Chuck Lever 0 siblings, 0 replies; 3+ messages in thread From: Chuck Lever @ 2007-10-29 16:08 UTC (permalink / raw) To: Talpey, Thomas; +Cc: nfs [-- Attachment #1: Type: text/plain, Size: 3246 bytes --] Talpey, Thomas wrote: > But... 2049 is only valid for TCP. Ther eis no such guarantee for RDMA, > SCTP, etc etc. Wouldn't it be safer/better to fail the mount if no port > is specified? This is what rpcbind would do if it fails to resolve the port, > for example. I'm copying logic already used in the legacy mount ABI. See "case 1:" in the same switch statement. The behavior there, unless I'm mistaken, is that if no port is specified via a mount option, that's the same as saying "port=2049". RFC 3530 states 3.1. Ports and Transports Historically, NFS version 2 and version 3 servers have resided on port 2049. The registered port 2049 [RFC3232] for the NFS protocol should be the default configuration. Using the registered port for NFS services means the NFS client will not need to use the RPC binding protocols as described in [RFC1833]; this will allow NFS to transit firewalls. The last sentence fragment is pertinent here. Without the logic I add in this patch, text-based NFSv4 mounts won't transit firewalls that block the rpcbind protocol, but legacy NFSv4 mounts will work as expected. I'm not familiar with the v4.1 spec, but I assume (perhaps at my own risk) that the firewall transit requirement has not been changed. In any event, I understand that RDMA uses port 2050, but I thought that was just a place holder in the rpcbind protocol; the actual value of the port number is never used by the underlying RDMA transport. In other words, is this patch really going to affect RDMA mounts? > At 01:32 PM 10/26/2007, Chuck Lever wrote: >> Text-based mount option parsing introduced a minor regression in the >> behavior of NFS version 4 mounts. NFS version 4 is not supposed to require >> a running rpcbind service on the server in order for a mount to succeed. >> >> In other words, if the mount options don't specify a port number, the port >> number is supposed to default to 2049. For earlier versions of NFS, the >> default port number was zero in order to cause the RPC client to autobind >> to the server's NFS service. >> >> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> >> --- >> >> fs/nfs/super.c | 2 ++ >> 1 files changed, 2 insertions(+), 0 deletions(-) >> >> diff --git a/fs/nfs/super.c b/fs/nfs/super.c >> index fa517ae..1b2fac8 100644 >> --- a/fs/nfs/super.c >> +++ b/fs/nfs/super.c >> @@ -1612,6 +1612,8 @@ static int nfs4_validate_mount_data(void *options, >> if (nfs_parse_mount_options((char *)options, args) == 0) >> return -EINVAL; >> >> + if (args->nfs_server.address.sin_port == 0) >> + args->nfs_server.address.sin_port = htons(NFS_PORT); >> if (!nfs_verify_server_address((struct sockaddr *) >> &args->nfs_server.address)) >> return -EINVAL; >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> NFS maillist - NFS@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/nfs [-- Attachment #2: chuck.lever.vcf --] [-- Type: text/x-vcard, Size: 259 bytes --] begin:vcard fn:Chuck Lever n:Lever;Chuck org:Oracle Corporation;Corporate Architecture: Linux Projects Group adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA title:Principal Member of Staff tel;work:+1 248 614 5091 x-mozilla-html:FALSE version:2.1 end:vcard [-- Attachment #3: Type: text/plain, Size: 314 bytes --] ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ [-- Attachment #4: Type: text/plain, Size: 140 bytes --] _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-10-29 16:08 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-10-26 17:32 [PATCH 19/27] NFS: Ensure that NFS version 4 mounts use NFS_PORT if nfsport wasn't set Chuck Lever 2007-10-29 14:59 ` Talpey, Thomas 2007-10-29 16:08 ` Chuck Lever
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox