lockd: ratelimit "lockd: cannot monitor" messages
authorJeff Layton <jlayton@primarydata.com>
Fri, 31 Oct 2014 12:28:29 +0000 (08:28 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 6 Nov 2014 19:47:33 +0000 (14:47 -0500)
When lockd can't talk to a remote statd, it'll spew a warning message
to the ring buffer. If the application is really hammering on locks
however, it's possible for that message to spam the logs. Ratelimit it
to minimize the potential for harm.

Reported-by: Ian Collier <imc@cs.ox.ac.uk>
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/lockd/mon.c

index 9106f42..1cc6ec5 100644 (file)
@@ -214,7 +214,7 @@ int nsm_monitor(const struct nlm_host *host)
        if (unlikely(res.status != 0))
                status = -EIO;
        if (unlikely(status < 0)) {
-               printk(KERN_NOTICE "lockd: cannot monitor %s\n", nsm->sm_name);
+               pr_notice_ratelimited("lockd: cannot monitor %s\n", nsm->sm_name);
                return status;
        }