Linux NFS development
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: linux-nfs@vger.kernel.org
Cc: "J. Bruce Fields" <bfields@citi.umich.edu>,
	Trond Myklebust <Trond.Myklebust@netapp.com>
Subject: [PATCH 25/37] rpc: bring back cl_chatty
Date: Thu, 12 Jun 2008 15:22:01 -0400	[thread overview]
Message-ID: <20080612192201.24528.48848.stgit@localhost.localdomain> (raw)
In-Reply-To: <20080612192159.24528.43756.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>

From: Olga Kornievskaia <aglo@citi.umich.edu>

The cl_chatty flag alows us to control whether a given rpc client leaves

	"server X not responding, timed out"

messages in the syslog.  Such messages make sense for ordinary nfs
clients (where an unresponsive server means applications on the
mountpoint are probably hanging), but not for the callback client (which
can fail more commonly, with the only result just of disabling some
optimizations).

Previously cl_chatty was removed, do to lack of users; reinstate it, and
use it for the nfsd's callback client.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---

 fs/nfsd/nfs4callback.c      |    2 +-
 include/linux/sunrpc/clnt.h |    4 +++-
 net/sunrpc/clnt.c           |   16 +++++++++++-----
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 4d4760e..702fa57 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -381,7 +381,7 @@ static int do_probe_callback(void *data)
 		.program	= &cb_program,
 		.version	= nfs_cb_version[1]->number,
 		.authflavor	= RPC_AUTH_UNIX, /* XXX: need AUTH_GSS... */
-		.flags		= (RPC_CLNT_CREATE_NOPING),
+		.flags		= (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET),
 	};
 	struct rpc_message msg = {
 		.rpc_proc       = &nfs4_cb_procedures[NFSPROC4_CLNT_CB_NULL],
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 6fff7f8..764fd4c 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -42,7 +42,8 @@ struct rpc_clnt {
 
 	unsigned int		cl_softrtry : 1,/* soft timeouts */
 				cl_discrtry : 1,/* disconnect before retry */
-				cl_autobind : 1;/* use getport() */
+				cl_autobind : 1,/* use getport() */
+				cl_chatty   : 1;/* be verbose */
 
 	struct rpc_rtt *	cl_rtt;		/* RTO estimator data */
 	const struct rpc_timeout *cl_timeout;	/* Timeout strategy */
@@ -114,6 +115,7 @@ struct rpc_create_args {
 #define RPC_CLNT_CREATE_NONPRIVPORT	(1UL << 3)
 #define RPC_CLNT_CREATE_NOPING		(1UL << 4)
 #define RPC_CLNT_CREATE_DISCRTRY	(1UL << 5)
+#define RPC_CLNT_CREATE_QUIET		(1UL << 6)
 
 struct rpc_clnt *rpc_create(struct rpc_create_args *args);
 struct rpc_clnt	*rpc_bind_new_program(struct rpc_clnt *,
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 0530eea..09631f6 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -324,6 +324,8 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
 		clnt->cl_autobind = 1;
 	if (args->flags & RPC_CLNT_CREATE_DISCRTRY)
 		clnt->cl_discrtry = 1;
+	if (!(args->flags & RPC_CLNT_CREATE_QUIET))
+		clnt->cl_chatty = 1;
 
 	return clnt;
 }
@@ -1149,7 +1151,8 @@ call_status(struct rpc_task *task)
 		rpc_exit(task, status);
 		break;
 	default:
-		printk("%s: RPC call returned error %d\n",
+		if (clnt->cl_chatty)
+			printk("%s: RPC call returned error %d\n",
 			       clnt->cl_protname, -status);
 		rpc_exit(task, status);
 	}
@@ -1174,7 +1177,8 @@ 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",
+		if (clnt->cl_chatty)
+			printk(KERN_NOTICE "%s: server %s not responding, timed out\n",
 				clnt->cl_protname, clnt->cl_server);
 		rpc_exit(task, -EIO);
 		return;
@@ -1182,7 +1186,8 @@ call_timeout(struct rpc_task *task)
 
 	if (!(task->tk_flags & RPC_CALL_MAJORSEEN)) {
 		task->tk_flags |= RPC_CALL_MAJORSEEN;
-		printk(KERN_NOTICE "%s: server %s not responding, still trying\n",
+		if (clnt->cl_chatty)
+			printk(KERN_NOTICE "%s: server %s not responding, still trying\n",
 			clnt->cl_protname, clnt->cl_server);
 	}
 	rpc_force_rebind(clnt);
@@ -1213,8 +1218,9 @@ call_decode(struct rpc_task *task)
 			task->tk_pid, task->tk_status);
 
 	if (task->tk_flags & RPC_CALL_MAJORSEEN) {
-		printk(KERN_NOTICE "%s: server %s OK\n",
-			clnt->cl_protname, clnt->cl_server);
+		if (clnt->cl_chatty)
+			printk(KERN_NOTICE "%s: server %s OK\n",
+				clnt->cl_protname, clnt->cl_server);
 		task->tk_flags &= ~RPC_CALL_MAJORSEEN;
 	}
 


  parent reply	other threads:[~2008-06-12 19:34 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12 19:22 [PATCH 00/37] Patches to be added to the 'devel' branch Trond Myklebust
     [not found] ` <20080612192159.24528.43756.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-06-12 19:22   ` [PATCH 14/37] SUNRPC: Refactor rpc_show_tasks Trond Myklebust
2008-06-12 19:22   ` [PATCH 03/37] NFS: Add correct bounds checking to NFSv2 locks Trond Myklebust
2008-06-12 19:22   ` [PATCH 06/37] NFS: Optimise append writes with holes Trond Myklebust
2008-06-12 19:22   ` [PATCH 01/37] NFS: Fix a preemption count leak in nfs_update_request Trond Myklebust
2008-06-12 19:22   ` [PATCH 10/37] NFS: Update help text for CONFIG_NFS_FS Trond Myklebust
2008-06-12 19:22   ` [PATCH 05/37] SUNRPC: An ENOMEM error from call_encode is always fatal Trond Myklebust
     [not found]     ` <20080612192200.24528.71693.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-06-13 21:10       ` J. Bruce Fields
2008-06-12 19:22   ` [PATCH 15/37] SUNRPC: Display some debugging information as text rather than numbers Trond Myklebust
2008-06-12 19:22   ` [PATCH 11/37] SUNRPC: Add a function to display the name of an RPC procedure Trond Myklebust
2008-06-12 19:22   ` [PATCH 04/37] SUNRPC: Ensure we exit early in case of an encode error Trond Myklebust
2008-06-12 19:22   ` [PATCH 07/37] NFS: Revert commit 44dd151d Trond Myklebust
2008-06-12 19:22   ` [PATCH 16/37] NFS: Make nfs_fsync methods consistent Trond Myklebust
2008-06-12 19:22   ` [PATCH 12/37] SUNRPC: Rename "call_" functions that are no longer FSM states Trond Myklebust
2008-06-12 19:22   ` [PATCH 09/37] NFS: do_setlk(): don't flush caches when we have a delegation Trond Myklebust
2008-06-12 19:22   ` [PATCH 17/37] NFS: Make nfs_llseek methods consistent Trond Myklebust
2008-06-12 19:22   ` [PATCH 13/37] SUNRPC: Don't display the rpc_show_tasks header if there are no tasks Trond Myklebust
2008-06-12 19:22   ` [PATCH 02/37] NFS: nfs_updatepage(): don't mark page as dirty if an error occurred Trond Myklebust
2008-06-12 19:22   ` [PATCH 08/37] SUNRPC: Use GFP_NOFS when allocating credentials Trond Myklebust
     [not found]     ` <20080612192200.24528.65570.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-06-13 21:17       ` J. Bruce Fields
2008-06-13 21:26         ` Trond Myklebust
2008-06-13 21:31           ` J. Bruce Fields
2008-06-13 21:34             ` Trond Myklebust
2008-06-13 21:58               ` J. Bruce Fields
2008-06-13 22:07                 ` Trond Myklebust
2008-06-12 19:22   ` [PATCH 37/37] NFS: missing newline in NFS mount debugging message Trond Myklebust
2008-06-12 19:22   ` [PATCH 29/37] NFS: Fix the ftruncate() credential problem Trond Myklebust
2008-06-12 19:22   ` [PATCH 32/37] NFS: Move fs/nfs/iostat.h to include/linux Trond Myklebust
2008-06-12 19:22   ` [PATCH 36/37] NFS: Treat "intr" and "nointr" options as deprecated Trond Myklebust
2008-06-12 19:22   ` [PATCH 28/37] rpc: minor cleanup of scheduler callback code Trond Myklebust
2008-06-12 19:22   ` [PATCH 23/37] fs/nfs/nfsroot.c: remove CVS keyword Trond Myklebust
2008-06-12 19:22   ` [PATCH 22/37] SUNRPC: Remove obsolete messages during transport connect Trond Myklebust
2008-06-12 19:22   ` [PATCH 26/37] rpc: eliminate unused variable in auth_gss upcall code Trond Myklebust
2008-06-12 19:22   ` [PATCH 24/37] NFS: implement option checking when remounting NFS filesystems (resend) Trond Myklebust
2008-06-12 19:22   ` Trond Myklebust [this message]
2008-06-12 19:22   ` [PATCH 27/37] rpc: remove some unused macros Trond Myklebust
2008-06-12 19:22   ` [PATCH 21/37] NFS: Fix trace debugging nits in write.c Trond Myklebust
2008-06-12 19:22   ` [PATCH 30/37] SUNRPC: Ensure all transports set rq_xtime consistently Trond Myklebust
2008-06-12 19:22   ` [PATCH 20/37] NFS: Use NFSDBG_FILE for all fops Trond Myklebust
2008-06-12 19:22   ` [PATCH 35/37] NFS: Allow any value for the "retry" option Trond Myklebust
2008-06-12 19:22   ` [PATCH 33/37] NFS: Fix a warning in nfs4_async_handle_error Trond Myklebust
2008-06-12 19:22   ` [PATCH 18/37] NFS: Make nfs_open methods consistent Trond Myklebust
2008-06-12 19:22   ` [PATCH 31/37] NFS: Remove the redundant file_open entry from struct nfs_rpc_ops Trond Myklebust
2008-06-12 19:22   ` [PATCH 19/37] NFS: Add debugging facility for NFS aops Trond Myklebust
2008-06-12 19:22   ` [PATCH 34/37] NFS: Ensure we zap only the access and acl caches when setting new acls Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080612192201.24528.48848.stgit@localhost.localdomain \
    --to=trond.myklebust@netapp.com \
    --cc=bfields@citi.umich.edu \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox