Commit ed8d9961 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Prevent scary warnings from knfsd

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 Brown <neilb@cse.unsw.edu.au> 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.
parent 7190b86d
...@@ -175,6 +175,14 @@ idtoname_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h) ...@@ -175,6 +175,14 @@ idtoname_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h)
return 0; 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 int idtoname_parse(struct cache_detail *, char *, int);
static struct ent *idtoname_lookup(struct ent *, int); static struct ent *idtoname_lookup(struct ent *, int);
...@@ -186,6 +194,7 @@ struct cache_detail idtoname_cache = { ...@@ -186,6 +194,7 @@ struct cache_detail idtoname_cache = {
.cache_request = idtoname_request, .cache_request = idtoname_request,
.cache_parse = idtoname_parse, .cache_parse = idtoname_parse,
.cache_show = idtoname_show, .cache_show = idtoname_show,
.warn_no_listener = warn_no_idmapd,
}; };
int int
...@@ -318,6 +327,7 @@ struct cache_detail nametoid_cache = { ...@@ -318,6 +327,7 @@ struct cache_detail nametoid_cache = {
.cache_request = nametoid_request, .cache_request = nametoid_request,
.cache_parse = nametoid_parse, .cache_parse = nametoid_parse,
.cache_show = nametoid_show, .cache_show = nametoid_show,
.warn_no_listener = warn_no_idmapd,
}; };
int int
......
...@@ -99,6 +99,7 @@ struct cache_detail { ...@@ -99,6 +99,7 @@ struct cache_detail {
atomic_t readers; /* how many time is /chennel open */ atomic_t readers; /* how many time is /chennel open */
time_t last_close; /* if no readers, when did last close */ time_t last_close; /* if no readers, when did last close */
time_t last_warn; /* when we last warned about no readers */ time_t last_warn; /* when we last warned about no readers */
void (*warn_no_listener)(struct cache_detail *cd);
}; };
......
...@@ -910,9 +910,8 @@ void warn_no_listener(struct cache_detail *detail) ...@@ -910,9 +910,8 @@ void warn_no_listener(struct cache_detail *detail)
{ {
if (detail->last_warn != detail->last_close) { if (detail->last_warn != detail->last_close) {
detail->last_warn = detail->last_close; detail->last_warn = detail->last_close;
printk(KERN_WARNING "nfsd: nobody listening for %s upcall;" if (detail->warn_no_listener)
" has some daemon %s?\n", detail->name, detail->warn_no_listener(detail);
detail->last_close?"died" : "not been started");
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment