lockd: ratelimit "lockd: cannot monitor" messages
Subsystems (2)
PATCH 1/1 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.
--- fs/lockd/mon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/lockd/mon.c +1 -1
@@ -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; }
Signature · 1 line
1.9.3
Quoted 16 lines · Jeff Layton
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 <[email protected]>Signed-off-by Jeff Layton <[email protected]>--- fs/lockd/mon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/lockd/mon.c +0
-0
fs/lockd/mon.c int nsm_monitor(const struct nlm_host *host) · line 220
Quoted 8 lines
fs/lockd/mon.c +1
-1@@ -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; }
How is this being triggered repeatedly? Normally, the 'cannot monitor' message should be happening at client mount time or not at all.
Signature · 5 lines
Trond Myklebust Linux NFS client maintainer, PrimaryData [email protected]
Quoted 12 lines · On Fri, 31 Oct 2014 14:36:16 +0200 Trond Myklebust…
Quoted 11 lines · Jeff Layton
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 <[email protected]>Signed-off-by Jeff Layton <[email protected]>--- fs/lockd/mon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 17 lines
fs/lockd/mon.c int nsm_monitor(const struct nlm_host *host) · line 220
Quoted 13 lines
fs/lockd/mon.c +1
-1@@ -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; }How is this being triggered repeatedly? Normally, the 'cannot monitor' message should be happening at client mount time or not at all.
No, it's triggered on NLM lock activity. I don't think we really do much with NLM at mount time, do we? In any case, the bug was reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=1155232
In this case, it was an application that was apparently responding to ENOLCK errors by retrying the lock.
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 4 lines · Jeff Layton
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.
Thanks, applying for 3.19.--b.
Quoted 23 lines
Reported-by Ian Collier <[email protected]>Signed-off-by Jeff Layton <[email protected]>--- fs/lockd/mon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/lockd/mon.c +1
-1@@ -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; }Signature · 1 line
1.9.3