From: David Howells <dhowells@redhat.com>
To: torvalds@linux-foundation.com
Cc: linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org,
linux-api@vger.kernel.org, linux-kernel@vger.kernel.org,
libc-alpha@sourceware.org, David Howells <dhowells@redhat.com>,
Jeff Layton <jlayton@redhat.com>,
Steven Whitehouse <swhiteho@redhat.com>,
Steve Dickson <steved@redhat.com>
Subject: [PATCH 2/2] Define ENONAMESERVICE and ENAMEUNKNOWN to indicate name service errors
Date: Thu, 22 Mar 2012 13:35:45 +0000 [thread overview]
Message-ID: <20120322133545.23390.4182.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20120322133531.23390.95890.stgit@warthog.procyon.org.uk>
Now that the kernel has filesystems (and possibly other services) that want to
look up internet addresses corresponding to arbitrary hostnames retrieved from
the server, it would seem useful to provide a couple of error codes to indicate
problems with the look up, rather than overloading some other error code.
Define ENONAMESERVICE to indicate "Network name service unavailable". This can
be used to indicate, for example, that an attempt was made by dns_query() to
make a query, but the name server (e.g. a DNS server) it is supposed to contact
didn't answer or that it couldn't determine the location of a suitable server.
Define ENAMEUNKNOWN to indicate "Network name unknown". This can be used to
indicate, for example, that an attempt was made by dns_query() to make a query,
but the name server (e.g. a DNS server) replied indicating that it had no
matching records.
The DNS query upcall program can report these to keyctl_reject() so that cached
failed queries will respond with these errors until they expire.
I envision that these errors would primarily be generated by a kernel upcall
for the kernel to then pass back to the original userspace caller. The kernel
itself might not actually pay any attention to them, except as hints as to
whether to retry.
I have combined the NXDOMAIN and NODATA resolver errors into ENAMEUNKNOWN. I'm
not sure whether it's worth separating them out. I don't see the kernel really
needing to know the difference - if any optimised handling of NODATA is to be
done (say falling back from one DNS record type to another), I would expect
that to be done in the upcall rather than in the kernel.
However, it may be worth it from the point of view of reporting to the user.
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
---
arch/alpha/include/asm/errno.h | 2 ++
arch/mips/include/asm/errno.h | 2 ++
arch/parisc/include/asm/errno.h | 2 ++
arch/sparc/include/asm/errno.h | 2 ++
include/asm-generic/errno.h | 2 ++
5 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/arch/alpha/include/asm/errno.h b/arch/alpha/include/asm/errno.h
index dce5fc9..a4fc77e 100644
--- a/arch/alpha/include/asm/errno.h
+++ b/arch/alpha/include/asm/errno.h
@@ -125,5 +125,7 @@
#define EHWPOISON 139 /* Memory page has hardware error */
#define ENOAUTHSERVICE 140 /* Authentication service not available */
+#define ENONAMESERVICE 141 /* Network name service unavailable */
+#define ENAMEUNKNOWN 142 /* Network name unknown */
#endif
diff --git a/arch/mips/include/asm/errno.h b/arch/mips/include/asm/errno.h
index 67c46bd..ac95669 100644
--- a/arch/mips/include/asm/errno.h
+++ b/arch/mips/include/asm/errno.h
@@ -123,6 +123,8 @@
#define EHWPOISON 168 /* Memory page has hardware error */
#define ENOAUTHSERVICE 169 /* Authentication service not available */
+#define ENONAMESERVICE 170 /* Network name service unavailable */
+#define ENAMEUNKNOWN 171 /* Network name unknown */
#define EDQUOT 1133 /* Quota exceeded */
diff --git a/arch/parisc/include/asm/errno.h b/arch/parisc/include/asm/errno.h
index 3a6ffcd..753cc5c 100644
--- a/arch/parisc/include/asm/errno.h
+++ b/arch/parisc/include/asm/errno.h
@@ -124,5 +124,7 @@
#define EHWPOISON 257 /* Memory page has hardware error */
#define ENOAUTHSERVICE 258 /* Authentication service not available */
+#define ENONAMESERVICE 259 /* Network name service unavailable */
+#define ENAMEUNKNOWN 260 /* Network name unknown */
#endif
diff --git a/arch/sparc/include/asm/errno.h b/arch/sparc/include/asm/errno.h
index 94a878f..01c9769 100644
--- a/arch/sparc/include/asm/errno.h
+++ b/arch/sparc/include/asm/errno.h
@@ -114,5 +114,7 @@
#define EHWPOISON 135 /* Memory page has hardware error */
#define ENOAUTHSERVICE 136 /* Authentication service not available */
+#define ENONAMESERVICE 137 /* Network name service unavailable */
+#define ENAMEUNKNOWN 138 /* Network name unknown */
#endif
diff --git a/include/asm-generic/errno.h b/include/asm-generic/errno.h
index 5e2b296..5d012c1 100644
--- a/include/asm-generic/errno.h
+++ b/include/asm-generic/errno.h
@@ -110,5 +110,7 @@
#define EHWPOISON 133 /* Memory page has hardware error */
#define ENOAUTHSERVICE 134 /* Authentication service not available */
+#define ENONAMESERVICE 135 /* Network name service unavailable */
+#define ENAMEUNKNOWN 136 /* Network name unknown */
#endif
next prev parent reply other threads:[~2012-03-22 13:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-22 13:35 [PATCH 1/2] Define ENOAUTHSERVICE to indicate "Authentication service unavailable" David Howells
2012-03-22 13:35 ` David Howells [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-02-08 12:29 David Howells
[not found] ` <20120208122905.8902.65762.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2012-02-08 12:29 ` [PATCH 2/2] Define ENONAMESERVICE and ENAMEUNKNOWN to indicate name service errors David Howells
[not found] ` <20120208122917.8902.78395.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2012-02-08 14:15 ` Jim Rees
[not found] ` <20120208141552.GA3273-63aXycvo3TyHXe+LvDLADg@public.gmane.org>
2012-02-09 10:04 ` David Howells
[not found] ` <17614.1328781889-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-02-09 13:44 ` Jim Rees
[not found] ` <20120209134429.GC6663-63aXycvo3TyHXe+LvDLADg@public.gmane.org>
2012-02-10 20:02 ` David Howells
2011-03-07 15:02 [PATCH 1/2] Define ENOAUTHSERVICE to indicate "Authentication service unavailable" David Howells
[not found] ` <20110307150208.28218.89348.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2011-03-07 15:02 ` [PATCH 2/2] Define ENONAMESERVICE and ENAMEUNKNOWN to indicate name service errors David Howells
[not found] ` <20110307150218.28218.84916.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2011-03-07 16:00 ` Alan Cox
2011-03-08 15:09 ` David Howells
2011-03-08 15:25 ` Alan Cox
2011-03-08 16:37 ` David Howells
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=20120322133545.23390.4182.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=jlayton@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.com \
--cc=swhiteho@redhat.com \
--cc=torvalds@linux-foundation.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).