From 9af94fc4e470deab3427d07551725f0bf844ebc8 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Fri, 31 Oct 2014 08:28:29 -0400 Subject: [PATCH] lockd: ratelimit "lockd: cannot monitor" messages 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 Signed-off-by: Jeff Layton Signed-off-by: J. Bruce Fields --- fs/lockd/mon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c index 9106f42..1cc6ec5 100644 --- a/fs/lockd/mon.c +++ b/fs/lockd/mon.c @@ -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; } -- 2.7.4