]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
SUNRPC: Ensure to ratelimit the "server not responding" syslog messages
authorTrond Myklebust <trondmy@gmail.com>
Sun, 7 Apr 2019 17:58:57 +0000 (13:58 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 25 Apr 2019 18:18:13 +0000 (14:18 -0400)
In particular, the timeout messages can be very noisy, so we ought to
ratelimit them in order to avoid spamming the syslog.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/clnt.c

index 43d6815f73917efa7ed12480fe9a96e19ec38b7d..b16322eb6c429c8e3696a23a5e409d243504a2b2 100644 (file)
@@ -2328,7 +2328,8 @@ rpc_check_timeout(struct rpc_task *task)
                        return;
 
                if (clnt->cl_chatty) {
-                       printk(KERN_NOTICE "%s: server %s not responding, timed out\n",
+                       pr_notice_ratelimited(
+                               "%s: server %s not responding, timed out\n",
                                clnt->cl_program->name,
                                task->tk_xprt->servername);
                }
@@ -2342,9 +2343,10 @@ rpc_check_timeout(struct rpc_task *task)
        if (!(task->tk_flags & RPC_CALL_MAJORSEEN)) {
                task->tk_flags |= RPC_CALL_MAJORSEEN;
                if (clnt->cl_chatty) {
-                       printk(KERN_NOTICE "%s: server %s not responding, still trying\n",
-                       clnt->cl_program->name,
-                       task->tk_xprt->servername);
+                       pr_notice_ratelimited(
+                               "%s: server %s not responding, still trying\n",
+                               clnt->cl_program->name,
+                               task->tk_xprt->servername);
                }
        }
        rpc_force_rebind(clnt);
@@ -2374,7 +2376,7 @@ call_decode(struct rpc_task *task)
 
        if (task->tk_flags & RPC_CALL_MAJORSEEN) {
                if (clnt->cl_chatty) {
-                       printk(KERN_NOTICE "%s: server %s OK\n",
+                       pr_notice_ratelimited("%s: server %s OK\n",
                                clnt->cl_program->name,
                                task->tk_xprt->servername);
                }