
From: "J. Bruce Fields" <bfields@fieldses.org>

The kernel currently prints:

 nfsd: nobody listening for auth.unix.ip upcall; has some daemon not been started?

on every bootup, during initscripts.

Neil says:

  It was part of the recent set of idmapper patches.  Bruce wanted the admin
  to get a warning when the idmapper daemon wasn't running.  I thought the
  same warning should apply to any daemon that responded to upcalls.

  In the case of auth.unix.ip it isn't strictly necessary for a daemon to be
  running (for comparability with 2.4).

  You can get rid of the warning by doing:

    mount -t nfsd nfsd /proc/fs/nfs

  before mountd is started (init scripts should start doing this I hope, but
  distributions don't tend to use the init script from nfs-utils, so it is
  hard to push it).  This will trigger mountd to listen on auth.unix.ip and
  others.  


That's a hassle, so Bruce's patch limits the warning purely to the new
idmapper cache.  It provides a callback in the cache_detail that individual
caches can use to log messages when upcalls fail because a userspace daemon
not running.  Implement this method for the idmapping caches.


---

 25-akpm/fs/nfsd/nfs4idmap.c          |   10 ++++++++++
 25-akpm/include/linux/sunrpc/cache.h |    1 +
 25-akpm/net/sunrpc/cache.c           |    5 ++---
 3 files changed, 13 insertions(+), 3 deletions(-)

diff -puN fs/nfsd/nfs4idmap.c~fix-knfsd-scary-message fs/nfsd/nfs4idmap.c
--- 25/fs/nfsd/nfs4idmap.c~fix-knfsd-scary-message	Thu May 20 15:55:50 2004
+++ 25-akpm/fs/nfsd/nfs4idmap.c	Thu May 20 15:55:50 2004
@@ -175,6 +175,14 @@ idtoname_show(struct seq_file *m, struct
 	return 0;
 }
 
+static void
+warn_no_idmapd(struct cache_detail *detail)
+{
+	printk("nfsd: nfsv4 idmapping failing: has idmapd %s?\n",
+			detail->last_close? "died" : "not been started");
+}
+
+
 static int         idtoname_parse(struct cache_detail *, char *, int);
 static struct ent *idtoname_lookup(struct ent *, int);
 
@@ -186,6 +194,7 @@ struct cache_detail idtoname_cache = {
 	.cache_request	= idtoname_request,
 	.cache_parse	= idtoname_parse,
 	.cache_show	= idtoname_show,
+	.warn_no_listener = warn_no_idmapd,
 };
 
 int
@@ -318,6 +327,7 @@ struct cache_detail nametoid_cache = {
 	.cache_request	= nametoid_request,
 	.cache_parse	= nametoid_parse,
 	.cache_show	= nametoid_show,
+	.warn_no_listener = warn_no_idmapd,
 };
 
 int
diff -puN include/linux/sunrpc/cache.h~fix-knfsd-scary-message include/linux/sunrpc/cache.h
--- 25/include/linux/sunrpc/cache.h~fix-knfsd-scary-message	Thu May 20 15:55:50 2004
+++ 25-akpm/include/linux/sunrpc/cache.h	Thu May 20 15:55:50 2004
@@ -99,6 +99,7 @@ struct cache_detail {
 	atomic_t		readers;		/* how many time is /chennel open */
 	time_t			last_close;		/* if no readers, when did last close */
 	time_t			last_warn;		/* when we last warned about no readers */
+	void			(*warn_no_listener)(struct cache_detail *cd);
 };
 
 
diff -puN net/sunrpc/cache.c~fix-knfsd-scary-message net/sunrpc/cache.c
--- 25/net/sunrpc/cache.c~fix-knfsd-scary-message	Thu May 20 15:55:50 2004
+++ 25-akpm/net/sunrpc/cache.c	Thu May 20 15:55:50 2004
@@ -910,9 +910,8 @@ void warn_no_listener(struct cache_detai
 {
 	if (detail->last_warn != detail->last_close) {
 		detail->last_warn = detail->last_close;
-		printk(KERN_WARNING "nfsd: nobody listening for %s upcall;"
-				" has some daemon %s?\n", detail->name,
-		      		detail->last_close?"died" : "not been started");
+		if (detail->warn_no_listener)
+			detail->warn_no_listener(detail);
 	}
 }
 

_
