On Thu, 2008-03-27 at 17:56 -0400, Olga Kornievskaia wrote: > From: Olga Kornievskaia <aglo@xxxxxxxxxxxxxxxxxxxxxx> > > Another attempt to silence call_timeout() prints by bringing back "chatty". > > 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. > > --- > fs/nfsd/nfs4callback.c | 2 +- > include/linux/sunrpc/clnt.h | 4 +++- > net/sunrpc/clnt.c | 5 ++++- > 3 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c > index aae2b29..00d3448 100644 > --- a/fs/nfsd/nfs4callback.c > +++ b/fs/nfsd/nfs4callback.c > @@ -367,7 +367,7 @@ static int do_probe_callback(void *data) > .program = 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 129a86e..249f7a2 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 8c6a7f1..3aa3348 100644 > --- a/net/sunrpc/clnt.c > +++ b/net/sunrpc/clnt.c > @@ -328,6 +328,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 = 0; Shouldn't that be if (!(args->flags & RPC_CLNT_CREATE_QUIET)) clnt->cl_chatty = 1; since clnt->cl_chatty is automatically initialised to 0? > > return clnt; > } > @@ -1160,7 +1162,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; -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html