Skip to contentSkip to conversation

CONFIG_NFSD_TCP actually impacts clients

PATCH In review Chris Abbey 5 participants 6 messages Jun 29, 2006 – Jul 6, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---

 Kconfig       |   10 +++++-----
 lockd/svc.c   |    2 +-
 nfsd/nfssvc.c |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
fs/Kconfig +5 -5
diff -purN linux-2.6.16.20-virgin/fs/Kconfig linux-2.6.16.20/fs/Kconfig
@@ -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

fs/lockd/svc.c +1 -1
@@ -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;

Signature · 11 lines
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
#1 lore raw
Quoted 11 lines · Chris Abbey

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

Quoted 59 lines

IBM LTC Bugzilla #24739

---

 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

fs/Kconfig +5 -5
@@ -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

fs/lockd/svc.c +1 -1
@@ -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

fs/lockd/svc.c nfsd_svc(unsigned short port, int nrserv · line 211

Quoted 8 lines
fs/lockd/svc.c +1 -1
@@ -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

#2 lore raw
In reply to Chris Abbey

Hi Chris-

fs/Kconfig config NFSD_V4 · line 1498

Quoted 5 lines · Chris Abbey
fs/Kconfig +2 -3
-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.

Signature · 10 lines
"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
#3 lore raw
Quoted 14 lines · Chuck Lever

Hi Chris-

fs/Kconfig config NFSD_V4 · line 1498

Quoted 5 lines · Chris Abbey
fs/Kconfig +2 -3
-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:

Quoted 4 lines

"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

#4 lore raw
In reply to Chuck Lever
Quoted 14 lines · On Friday June 30, [email protected] wrote:

Hi Chris-

fs/Kconfig config NFSD_V4 · line 1498

Quoted 5 lines · Chris Abbey
fs/Kconfig +2 -3
-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:

Quoted 4 lines

"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

#5 lore raw
Quoted 2 lines · Trond Myklebust

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

Quoted 2 lines · Neil Brown

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?

Signature · 9 lines
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