Linux NFS development
 help / color / mirror / Atom feed
* [PATCH 1/1] silence-call-timeout-printk
@ 2008-03-27 18:49 Olga Kornievskaia
  2008-03-27 19:54 ` J. Bruce Fields
  0 siblings, 1 reply; 10+ messages in thread
From: Olga Kornievskaia @ 2008-03-27 18:49 UTC (permalink / raw)
  To: bfields, linux-nfs; +Cc: Olga Kornievskaia

When the client's callback server goes away, the server's callback client
tries to contact the server and times out. For nfsd, it is beneficial to
printout a message when the client is unable to contact the server. For
the callback server, the same message is printed yet it is really not
an error. Thus we need a way to silence the message for the callback 
and yet print it for other cases.

Signed-off-by: Olga Kornievskaia <aglo@umich.edu>
---
 fs/nfsd/nfs4callback.c      |    1 +
 include/linux/sunrpc/clnt.h |    1 +
 net/sunrpc/clnt.c           |    6 ++++--
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index aae2b29..bf7d57e 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -400,6 +400,7 @@ static int do_probe_callback(void *data)
 		status = PTR_ERR(client);
 		goto out_err;
 	}
+	client->cl_quiet = 1;
 
 	status = rpc_call_sync(client, &msg, RPC_TASK_SOFT);
 
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 129a86e..0a1141e 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -57,6 +57,7 @@ struct rpc_clnt {
 	struct rpc_timeout	cl_timeout_default;
 	struct rpc_program *	cl_program;
 	char			cl_inline_name[32];
+	int                     cl_quiet; /* silences call_timeout printk */
 };
 
 /*
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 8c6a7f1..5a2a718 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1160,8 +1160,10 @@ call_timeout(struct rpc_task *task)
 	task->tk_timeouts++;
 
 	if (RPC_IS_SOFT(task)) {
-		printk(KERN_NOTICE "%s: server %s not responding, timed out\n",
-				clnt->cl_protname, clnt->cl_server);
+		if (!clnt->cl_quiet)
+			printk(KERN_NOTICE "%s: server %s not responding, "
+				"timed out\n", clnt->cl_protname, 
+				clnt->cl_server);
 		rpc_exit(task, -EIO);
 		return;
 	}
-- 
1.5.3.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-03-28 15:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-27 18:49 [PATCH 1/1] silence-call-timeout-printk Olga Kornievskaia
2008-03-27 19:54 ` J. Bruce Fields
2008-03-27 20:03   ` Trond Myklebust
     [not found]     ` <1206648229.15396.2.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2008-03-27 20:23       ` J. Bruce Fields
2008-03-27 20:31         ` Trond Myklebust
     [not found]           ` <1206649882.15396.17.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2008-03-27 20:45             ` J. Bruce Fields
2008-03-27 20:36         ` Talpey, Thomas
     [not found]           ` <EXNANE01kO22ZhCl8ai000001cd-kboziUmgGqYSZCGxjG3uujkOHZLvdrmu@public.gmane.org>
2008-03-27 20:53             ` J. Bruce Fields
2008-03-27 20:57               ` Trond Myklebust
2008-03-28 15:57               ` Talpey, Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox