2006-06-29 20:22:57

by Chris Abbey

[permalink] [raw]
Subject: [PATCH] CONFIG_NFSD_TCP actually impacts clients

CONFIG_NFSD_TCP's name, description and dependency information imply
that it only impacts nfs servers. However in fs/lockd/svc.c this config option
gaurds binding lockd to tcp as well as udp. (If CONFIG_NFSD_TCP is not set,
then lockd will not bind to tcp.) If a kernel is configured as NFS client
only, such as for an embeddeed system, then this will cause locking to fail
on nfs mounts using TCP instead of UDP. Callers to F_SETLK will fail with
errno = 37 when trying to lock: "No locks available".

This patch changes the name, description, help text and dependency for
CONFIG_NFSD_TCP to accurately reflect it's usage. The main change is really
the removal of 'depends on NFSD', the rest is just cleanup.

IBM LTC Bugzilla #24739

Signed-off-by: Chris Abbey <[email protected]>

---

Kconfig | 10 +++++-----
lockd/svc.c | 2 +-
nfsd/nfssvc.c | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff -purN linux-2.6.16.20-virgin/fs/Kconfig linux-2.6.16.20/fs/Kconfig
--- linux-2.6.16.20-virgin/fs/Kconfig 2006-06-05 12:18:23.000000000 -0500
+++ linux-2.6.16.20/fs/Kconfig 2006-06-16 19:09:15.000000000 -0500
@@ -1484,7 +1484,7 @@ config NFSD_V3_ACL
config NFSD_V4
bool "Provide NFSv4 server support (EXPERIMENTAL)"
depends on NFSD_V3 && EXPERIMENTAL
- select NFSD_TCP
+ select NFS_TCP
select CRYPTO_MD5
select CRYPTO
select FS_POSIX_ACL
@@ -1494,12 +1494,12 @@ config NFSD_V4
should only be used if you are interested in helping to test NFSv4.
If unsure, say N.

-config NFSD_TCP
- bool "Provide NFS server over TCP support"
- depends on NFSD
+config NFS_TCP
+ bool "Provide NFS services over TCP"
default y
help
- If you want your NFS server to support TCP connections, say Y here.
+ If you want your NFS server to support TCP connections, or your NFS
+ clients to be able to lock over a TCP connection, then say Y here.
TCP connections usually perform better than the default UDP when
the network is lossy or congested. If unsure, say Y.

diff -purN linux-2.6.16.20-virgin/fs/lockd/svc.c
linux-2.6.16.20/fs/lockd/svc.c
--- linux-2.6.16.20-virgin/fs/lockd/svc.c 2006-06-05 12:18:23.000000000 -0500
+++ linux-2.6.16.20/fs/lockd/svc.c 2006-06-16 19:08:40.000000000 -0500
@@ -243,7 +243,7 @@ lockd_up(void)
}

if ((error = svc_makesock(serv, IPPROTO_UDP, nlm_udpport)) < 0
-#ifdef CONFIG_NFSD_TCP
+#ifdef CONFIG_NFS_TCP
|| (error = svc_makesock(serv, IPPROTO_TCP, nlm_tcpport)) < 0
#endif
) {
diff -purN linux-2.6.16.20-virgin/fs/nfsd/nfssvc.c
linux-2.6.16.20/fs/nfsd/nfssvc.c
--- linux-2.6.16.20-virgin/fs/nfsd/nfssvc.c 2006-06-05 12:18:23.000000000
-0500
+++ linux-2.6.16.20/fs/nfsd/nfssvc.c 2006-06-16 19:08:40.000000000 -0500
@@ -205,7 +205,7 @@ nfsd_svc(unsigned short port, int nrserv
if (error < 0)
goto failure;

-#ifdef CONFIG_NFSD_TCP
+#ifdef CONFIG_NFS_TCP
error = svc_makesock(nfsd_serv, IPPROTO_TCP, port);
if (error < 0)
goto failure;

--
The value of Open Standards is only evident to Open Minds.



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2006-06-29 23:11:12

by Trond Myklebust

[permalink] [raw]
Subject: Re: [PATCH] CONFIG_NFSD_TCP actually impacts clients

On Thu, 2006-06-29 at 15:22 -0500, Chris Abbey wrote:
> CONFIG_NFSD_TCP's name, description and dependency information imply
> that it only impacts nfs servers. However in fs/lockd/svc.c this config option
> gaurds binding lockd to tcp as well as udp. (If CONFIG_NFSD_TCP is not set,
> then lockd will not bind to tcp.) If a kernel is configured as NFS client
> only, such as for an embeddeed system, then this will cause locking to fail
> on nfs mounts using TCP instead of UDP. Callers to F_SETLK will fail with
> errno = 37 when trying to lock: "No locks available".
>
> This patch changes the name, description, help text and dependency for
> CONFIG_NFSD_TCP to accurately reflect it's usage. The main change is really
> the removal of 'depends on NFSD', the rest is just cleanup.

Good point, but it seems to me that it would make sense to have
CONFIG_NFS_FS automatically select it.

Cheers,
Trond

> IBM LTC Bugzilla #24739
>
> Signed-off-by: Chris Abbey <[email protected]>
>
> ---
>
> Kconfig | 10 +++++-----
> lockd/svc.c | 2 +-
> nfsd/nfssvc.c | 2 +-
> 3 files changed, 7 insertions(+), 7 deletions(-)
> diff -purN linux-2.6.16.20-virgin/fs/Kconfig linux-2.6.16.20/fs/Kconfig
> --- linux-2.6.16.20-virgin/fs/Kconfig 2006-06-05 12:18:23.000000000 -0500
> +++ linux-2.6.16.20/fs/Kconfig 2006-06-16 19:09:15.000000000 -0500
> @@ -1484,7 +1484,7 @@ config NFSD_V3_ACL
> config NFSD_V4
> bool "Provide NFSv4 server support (EXPERIMENTAL)"
> depends on NFSD_V3 && EXPERIMENTAL
> - select NFSD_TCP
> + select NFS_TCP
> select CRYPTO_MD5
> select CRYPTO
> select FS_POSIX_ACL
> @@ -1494,12 +1494,12 @@ config NFSD_V4
> should only be used if you are interested in helping to test NFSv4.
> If unsure, say N.
>
> -config NFSD_TCP
> - bool "Provide NFS server over TCP support"
> - depends on NFSD
> +config NFS_TCP
> + bool "Provide NFS services over TCP"
> default y
> help
> - If you want your NFS server to support TCP connections, say Y here.
> + If you want your NFS server to support TCP connections, or your NFS
> + clients to be able to lock over a TCP connection, then say Y here.
> TCP connections usually perform better than the default UDP when
> the network is lossy or congested. If unsure, say Y.
>
> diff -purN linux-2.6.16.20-virgin/fs/lockd/svc.c
> linux-2.6.16.20/fs/lockd/svc.c
> --- linux-2.6.16.20-virgin/fs/lockd/svc.c 2006-06-05 12:18:23.000000000 -0500
> +++ linux-2.6.16.20/fs/lockd/svc.c 2006-06-16 19:08:40.000000000 -0500
> @@ -243,7 +243,7 @@ lockd_up(void)
> }
>
> if ((error = svc_makesock(serv, IPPROTO_UDP, nlm_udpport)) < 0
> -#ifdef CONFIG_NFSD_TCP
> +#ifdef CONFIG_NFS_TCP
> || (error = svc_makesock(serv, IPPROTO_TCP, nlm_tcpport)) < 0
> #endif
> ) {
> diff -purN linux-2.6.16.20-virgin/fs/nfsd/nfssvc.c
> linux-2.6.16.20/fs/nfsd/nfssvc.c
> --- linux-2.6.16.20-virgin/fs/nfsd/nfssvc.c 2006-06-05 12:18:23.000000000
> -0500
> +++ linux-2.6.16.20/fs/nfsd/nfssvc.c 2006-06-16 19:08:40.000000000 -0500
> @@ -205,7 +205,7 @@ nfsd_svc(unsigned short port, int nrserv
> if (error < 0)
> goto failure;
>
> -#ifdef CONFIG_NFSD_TCP
> +#ifdef CONFIG_NFS_TCP
> error = svc_makesock(nfsd_serv, IPPROTO_TCP, port);
> if (error < 0)
> goto failure;
>


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-06-30 12:38:49

by Chuck Lever

[permalink] [raw]
Subject: Re: [PATCH] CONFIG_NFSD_TCP actually impacts clients

Hi Chris-

On 6/29/06, Chris Abbey <[email protected]> wrote:
> -config NFSD_TCP
> - bool "Provide NFS server over TCP support"
> - depends on NFSD
> +config NFS_TCP
> + bool "Provide NFS services over TCP"

There's been plenty of user confusion in the past about server versus
client TCP support, so I would prefer more precise wording here. This
new summary almost implies that the NFS client (not the lock manager)
is affected too. How about something more specific like:

"Provide NFS and NLM server over TCP support"

Also, the name of the config option might be confusing as well...
"NFS_" is usually reserved for client-only. I suggest NFSD_NLM_TCP.

--
"We who cut mere stones must always be envisioning cathedrals"
-- Quarry worker's creed

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-06-30 15:28:04

by Frank Filz

[permalink] [raw]
Subject: Re: [PATCH] CONFIG_NFSD_TCP actually impacts clients

On Fri, 2006-06-30 at 08:38 -0400, Chuck Lever wrote:
> Hi Chris-
>
> On 6/29/06, Chris Abbey <[email protected]> wrote:
> > -config NFSD_TCP
> > - bool "Provide NFS server over TCP support"
> > - depends on NFSD
> > +config NFS_TCP
> > + bool "Provide NFS services over TCP"
>
> There's been plenty of user confusion in the past about server versus
> client TCP support, so I would prefer more precise wording here. This
> new summary almost implies that the NFS client (not the lock manager)
> is affected too. How about something more specific like:
>
> "Provide NFS and NLM server over TCP support"
>
> Also, the name of the config option might be confusing as well...
> "NFS_" is usually reserved for client-only. I suggest NFSD_NLM_TCP.

The problem is that lockd also provides services to the NFS client, for
example the NLM_GRANTED rpc which goes from server to client to notify
the client of a granted blocking lock.

Frank Filz




Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-07-01 05:56:31

by NeilBrown

[permalink] [raw]
Subject: Re: [PATCH] CONFIG_NFSD_TCP actually impacts clients

On Friday June 30, [email protected] wrote:
> Hi Chris-
>
> On 6/29/06, Chris Abbey <[email protected]> wrote:
> > -config NFSD_TCP
> > - bool "Provide NFS server over TCP support"
> > - depends on NFSD
> > +config NFS_TCP
> > + bool "Provide NFS services over TCP"
>
> There's been plenty of user confusion in the past about server versus
> client TCP support, so I would prefer more precise wording here. This
> new summary almost implies that the NFS client (not the lock manager)
> is affected too. How about something more specific like:
>
> "Provide NFS and NLM server over TCP support"
>
> Also, the name of the config option might be confusing as well...
> "NFS_" is usually reserved for client-only. I suggest NFSD_NLM_TCP.

Another option would be to throw the option away altogether and
default to always listen on TCP. We have patches that are about
----> <------
this far away from being sent to the next -mm which will make protocol
selectable by rpc.nfsd.
They don't affect what protocol lockd listens on, but that is a little
awkward to manage because lockd does work for both the client and the
server....

Maybe 'lockd_up' should take some sort of protocol flag and it should
make sure the appropriate protocol was being used??

NeilBrown

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-07-06 21:57:12

by Chris Abbey

[permalink] [raw]
Subject: Re: [PATCH] CONFIG_NFSD_TCP actually impacts clients

On Thursday 29 June 2006 06:11 pm, Trond Myklebust wrote:
> Good point, but it seems to me that it would make sense to have
> CONFIG_NFS_FS automatically select it.

On Saturday 01 July 2006 12:56 am, Neil Brown wrote:
> Another option would be to throw the option away altogether and
> default to always listen on TCP.

These two thoughts both seem to follow along the same line of thinking I
originally started with: don't make tcp conditional. I'd be more than happy
to see TCP no longer be optional, that's actually what I had implemented at
first, but I figured it was still an option because someone somewhere in some
oddball configuration still needed to disable it. Given that the kernel IP
stack doesn't let you build IP without TCP, it doesn't seem like it's
possible to break anyone by removing this as an option... it's just the
slight overhead of having it enabled. (assuming they don't use it.)

Neil, is this something your upcoming protocol selection patch would include,
or should I put forward a seperate (trivial) removal patch?

--
The value of Open Standards is only evident to Open Minds.

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs