Skip to contentSkip to conversation

NFS: Disable AF_INET6 callback service if SUNRPC_REGISTER_V4 is disabled

PATCH New Chuck Lever 1 participant 1 message May 1, 2009

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

PATCH 1/1 NFS: Disable AF_INET6 callback service if SUNRPC_REGISTER_V4 is disabled

This works around a problem (fixed in 2.6.30) where unloading the ipv6.ko module causes mount.nfs4 to fail with "Cannot allocate memory."

SUNRPC_REGISTER_V4 is required for AF_INET6 support in NFS and lockd. If V4 rpcbind registration support isn't available in the kernel, lockd uses AF_INET only. NFSv4 callback does not register with rpcbind, so it doesn't care what flavor of rpcbind registration is available in the kernel.

For 2.6.29 we decided to use SUNRPC_REGISTER_V4 to disable IPv6 support in NFS and lockd to work around the requirement that ipv6.ko be loaded. But I forgot that the NFSv4 callback service would still try to start an AF_INET6 listener even if SUNRPC_REGISTER_V4 is disabled.

---

Hi Trond-

Would you consider this patch for 2.6.29-stable?

 fs/nfs/callback.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
fs/nfs/callback.c +2 -1
index 3e634f2..b59a614 100644
@@ -45,7 +45,8 @@ static const int nfs_set_port_max = 65535;
  * If the kernel has IPv6 support available, always listen for
  * both AF_INET and AF_INET6 requests.
  */
-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+#if (defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)) && \
+	defined(CONFIG_SUNRPC_REGISTER_V4)
 static const sa_family_t	nfs_callback_family = AF_INET6;
 #else
 static const sa_family_t	nfs_callback_family = AF_INET;