[PATCH 1/7] lockd: Use AF_INET6 listener only when IPv6 support is built in

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Apparently a lot of people need to completely disable IPv6 on their
distribution-built systems, and they do this by blacklisting the
ipv6 module.  This causes lockd_up(), and thus NFS mounts, to fail
in all cases (even for IPv4 mounts) if CONFIG_IPV6_MODULE and
CONFIG_SUNRPC_REGISTER_V4 is set.

As a workaround, change lockd to use an AF_INET6 listener only if IPv6
is built into the kernel.

This allows IPv6 NFS testing to continue, while supporting legacy IPv4
NFS as before.  In the meantime, we will pursue a long-term fix so that
lockd (and eventually NFSD) will be able to handle this case correctly.

Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
Tested-by: Steve Dickson <steved@xxxxxxxxxx>
---

 fs/lockd/svc.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 64f1c31..39ec7f2 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -54,14 +54,15 @@ unsigned long			nlmsvc_timeout;
 
 /*
  * If the kernel has IPv6 support available, always listen for
- * both AF_INET and AF_INET6 requests.
+ * both AF_INET and AF_INET6 requests.  To avoid breaking lockd
+ * if the ipv6 module was built but has been blacklisted, enable
+ * this only if IPv6 support is built into the kernel.
  */
-#if (defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)) && \
-	defined(CONFIG_SUNRPC_REGISTER_V4)
+#if defined(CONFIG_IPV6) && defined(CONFIG_SUNRPC_REGISTER_V4)
 static const sa_family_t	nlmsvc_family = AF_INET6;
-#else	/* (CONFIG_IPV6 || CONFIG_IPV6_MODULE) && CONFIG_SUNRPC_REGISTER_V4 */
+#else	/* CONFIG_IPV6 && CONFIG_SUNRPC_REGISTER_V4 */
 static const sa_family_t	nlmsvc_family = AF_INET;
-#endif	/* (CONFIG_IPV6 || CONFIG_IPV6_MODULE) && CONFIG_SUNRPC_REGISTER_V4 */
+#endif	/* CONFIG_IPV6 && CONFIG_SUNRPC_REGISTER_V4 */
 
 /*
  * These can be set at insmod time (useful for NFS as root filesystem),

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux