public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Bryan Schumaker <bjschuma-HgOvQuBEEgTQT0dZR+AlfA@public•gmane.org>
To: Stephen Rothwell <sfr-3FnU+UHB4dNDw9hX6IcOSA@public•gmane.org>
Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public•gmane.org>,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
	linux-next-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
	Wang Lei <wang840925-Re5JQEeQqe8AvxtiuMwx3w@public•gmane.org>,
	David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public•gmane.org>
Subject: Re: linux-next: build failure after merge of the cifs tree
Date: Thu, 12 Aug 2010 11:18:44 -0400	[thread overview]
Message-ID: <4C6410D4.6050100@netapp.com> (raw)
In-Reply-To: <20100812174621.b1dbc20f.sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>

Hi

I updated my NFS DNS patch.  The new version will set CONFIG_KEYS when CONFIG_NFS_USE_KERNEL_DNS is set.

Thanks for letting me know about this!

Bryan Schumaker



Use the kernel DNS resolver to translate hostnames to IP addresses.  Create a
new config option to choose between the legacy DNS resolver and the new
resolver.

Signed-off-by: Bryan Schumaker <bjschuma-HgOvQuBEEgTQT0dZR+AlfA@public•gmane.org>
Acked-by: Trond Myklebust <Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public•gmane.org>
---
Fix for KEYS dependency

 fs/nfs/Kconfig       |   16 ++++++++++++++++
 fs/nfs/dns_resolve.c |   24 ++++++++++++++++++++++++
 fs/nfs/dns_resolve.h |   12 ++++++++++++
 3 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig
index cc1bb33..c5bbdca 100644
--- a/fs/nfs/Kconfig
+++ b/fs/nfs/Kconfig
@@ -100,3 +100,19 @@ config NFS_FSCACHE
 	help
 	  Say Y here if you want NFS data to be cached locally on disc through
 	  the general filesystem cache manager
+
+config NFS_USE_LEGACY_DNS
+	bool "Use the legacy NFS DNS resolver"
+	depends on NFS_V4
+	help
+	  The kernel now provides a method for translating a host name into an
+	  IP address.  Select Y here if you would rather use your own DNS
+	  resolver script.
+
+	  If unsure, say N
+
+config NFS_USE_KERNEL_DNS
+	bool
+	depends on NFS_V4 && !NFS_USE_LEGACY_DNS
+	select DNS_RESOLVER
+	select KEYS
+	default y
diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c
index 76fd235..dba50a5 100644
--- a/fs/nfs/dns_resolve.c
+++ b/fs/nfs/dns_resolve.c
@@ -6,6 +6,29 @@
  * Resolves DNS hostnames into valid ip addresses
  */

+#ifdef CONFIG_NFS_USE_KERNEL_DNS
+
+#include <linux/sunrpc/clnt.h>
+#include <linux/dns_resolver.h>
+
+ssize_t nfs_dns_resolve_name(char *name, size_t namelen,
+		struct sockaddr *sa, size_t salen)
+{
+	ssize_t ret;
+	char *ip_addr = NULL;
+	int ip_len;
+
+	ip_len = dns_query(NULL, name, namelen, NULL, &ip_addr, NULL);
+	if (ip_len > 0)
+		ret = rpc_pton(ip_addr, ip_len, sa, salen);
+	else
+		ret = -ESRCH;
+	kfree(ip_addr);
+	return ret;
+}
+
+#else
+
 #include <linux/hash.h>
 #include <linux/string.h>
 #include <linux/kmod.h>
@@ -346,3 +369,4 @@ void nfs_dns_resolver_destroy(void)
 	nfs_cache_unregister(&nfs_dns_resolve);
 }

+#endif
diff --git a/fs/nfs/dns_resolve.h b/fs/nfs/dns_resolve.h
index a3f0938..199bb55 100644
--- a/fs/nfs/dns_resolve.h
+++ b/fs/nfs/dns_resolve.h
@@ -6,8 +6,20 @@

 #define NFS_DNS_HOSTNAME_MAXLEN	(128)

+
+#ifdef CONFIG_NFS_USE_KERNEL_DNS
+static inline int nfs_dns_resolver_init(void)
+{
+	return 0;
+}
+
+static inline void nfs_dns_resolver_destroy(void)
+{}
+#else
 extern int nfs_dns_resolver_init(void);
 extern void nfs_dns_resolver_destroy(void);
+#endif
+
 extern ssize_t nfs_dns_resolve_name(char *name, size_t namelen,
 		struct sockaddr *sa, size_t salen);




On 08/12/2010 03:46 AM, Stephen Rothwell wrote:
> Hi Steve,
> 
> On Wed, 11 Aug 2010 23:04:36 -0500 Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public•gmane.org> wrote:
>>
>> Are you sure that this is a valid config file?  CONFIG_KEYS should be
>> set if CONFIG_DNS_RESOLVER is set?
> 
> It is a ppc64_defconfig.  It has:
> 
> # CONFIG_KEYS is not set
> CONFIG_DNS_RESOLVER=y
> 
> CONFIG_NFS_USE_KERNEL_DNS just selects CONFIG_DNS_RESOLVER but there is
> no dependency on CONFIG_KEYS (select does not care about the
> dependencies of the selected config option).
> 
>> key.h looks like it is included in all arch in this path
>>
>> net/dns_resolver/dns_key.c includes
>> include/keys/dns_resolver-type.h which includes
>> include/linux/key-type.h which includes
>> include/linux/key.h
>>
>> the line 258 "key_instantiate_and_link" error could occur if
>> "CONFIG_KEYS" is not set in .config
> 
> Which t isn't.
> 
>> net/dns_resolver/Kconfig config DNS_RESOLVER "depends on NET && KEYS"
>> so ... CONFIG_KEYS should be set ....
> 
> See above.  You need CONFIG_NFS_USE_KERNEL_DNS to also depend on
> CONFIG_KEYS ...
> 

  parent reply	other threads:[~2010-08-12 15:18 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-12  3:17 linux-next: build failure after merge of the cifs tree Stephen Rothwell
     [not found] ` <20100812131741.f3a800d7.sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
2010-08-12  4:04   ` Steve French
2010-08-12  7:46     ` Stephen Rothwell
     [not found]       ` <20100812174621.b1dbc20f.sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
2010-08-12 15:18         ` Bryan Schumaker [this message]
2010-08-12 18:21         ` Steve French
     [not found] ` <AANLkTi=iHi=kpk+nsB396B9GWdefj=WJywA2K1PawHxi-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-12 15:24   ` David Howells
  -- strict thread matches above, loose matches on Subject: below --
2026-04-15 10:43 Mark Brown
2026-04-15 13:55 ` Steve French
2025-01-16 21:59 Stephen Rothwell
2025-01-17  4:58 ` Steve French
2024-03-19 22:59 Stephen Rothwell
2024-03-19 23:37 ` Steve French
2023-07-20  0:35 Stephen Rothwell
2023-07-20  0:47 ` Steve French
2023-07-20  1:00   ` Stephen Rothwell
2023-07-20  1:33     ` Winston Wen
2021-11-15 22:17 Stephen Rothwell
2021-11-15 22:35 ` Steve French
2021-11-10 21:57 Stephen Rothwell
2021-11-10 22:32 ` Steve French
2021-06-08 10:27 Stephen Rothwell
2021-06-08 10:53 ` Hyunchul Lee
2021-06-08 13:16   ` Steve French
2020-04-23  0:31 Stephen Rothwell
2020-04-23  1:31 ` Steve French
2018-06-24 23:15 Stephen Rothwell
2018-06-25  0:52 ` Steve French
2018-06-01  0:09 Stephen Rothwell
2018-06-01  0:19 ` Steve French
2017-09-26  0:51 Stephen Rothwell
2017-09-26  1:20 ` Steve French
2016-11-29 22:27 Stephen Rothwell
     [not found] ` <20161130092742.0f1cc03b-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
2016-12-01  6:27   ` Steve French
2012-08-06  0:48 Stephen Rothwell
     [not found] ` <20120806104841.07ed3708b600529ff7eb6fa6-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
2012-08-06  1:57   ` Steve French
2012-01-19  0:01 Stephen Rothwell
     [not found] ` <20120119110153.7ffa3312b2943386750ac7ed-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
2012-01-19  0:31   ` Steve French
2011-10-25 13:59 Stephen Rothwell
     [not found] ` <20111026005939.ad20ab7a2dacce216c69e821-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
2011-10-25 14:51   ` Steve French
2011-10-25 15:05     ` Steve French
2011-10-25 15:58       ` Jeff Layton
2011-10-25 15:55     ` Jeff Layton
2011-03-10  0:43 Stephen Rothwell
     [not found] ` <20110310114315.eb9aec89.sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
2011-03-10  1:03   ` Steve French
2010-09-23  1:20 Stephen Rothwell
2010-09-23  1:32 ` Steve French
     [not found]   ` <AANLkTimXtigjQwpL6i46JTiuREdLnr7Yh+2ZCuPfy06G-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-23  1:47     ` Steve French
2010-07-15 23:51 Stephen Rothwell
2010-07-16  4:34 ` Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C6410D4.6050100@netapp.com \
    --to=bjschuma-hgovqubeegtqt0dzr+alfa@public$(echo .)gmane.org \
    --cc=dhowells-H+wXaHxf7aLQT0dZR+AlfA@public$(echo .)gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=linux-next-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=sfr-3FnU+UHB4dNDw9hX6IcOSA@public$(echo .)gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public$(echo .)gmane.org \
    --cc=wang840925-Re5JQEeQqe8AvxtiuMwx3w@public$(echo .)gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox