提交 b03568c3 编写于 作者: \ \"J. Bruce Fields\ 提交者: Trond Myklebust

rpc: factor out warning code from gss_pipe_destroy_msg

We'll want to call this from elsewhere soon.  And this is a bit nicer
anyway.
Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 99db3563
...@@ -369,6 +369,18 @@ gss_setup_upcall(struct rpc_clnt *clnt, struct gss_auth *gss_auth, struct rpc_cr ...@@ -369,6 +369,18 @@ gss_setup_upcall(struct rpc_clnt *clnt, struct gss_auth *gss_auth, struct rpc_cr
return gss_msg; return gss_msg;
} }
static void warn_gssd(void)
{
static unsigned long ratelimit;
unsigned long now = jiffies;
if (time_after(now, ratelimit)) {
printk(KERN_WARNING "RPC: AUTH_GSS upcall timed out.\n"
"Please check user daemon is running.\n");
ratelimit = now + 15*HZ;
}
}
static inline int static inline int
gss_refresh_upcall(struct rpc_task *task) gss_refresh_upcall(struct rpc_task *task)
{ {
...@@ -568,21 +580,14 @@ static void ...@@ -568,21 +580,14 @@ static void
gss_pipe_destroy_msg(struct rpc_pipe_msg *msg) gss_pipe_destroy_msg(struct rpc_pipe_msg *msg)
{ {
struct gss_upcall_msg *gss_msg = container_of(msg, struct gss_upcall_msg, msg); struct gss_upcall_msg *gss_msg = container_of(msg, struct gss_upcall_msg, msg);
static unsigned long ratelimit;
if (msg->errno < 0) { if (msg->errno < 0) {
dprintk("RPC: gss_pipe_destroy_msg releasing msg %p\n", dprintk("RPC: gss_pipe_destroy_msg releasing msg %p\n",
gss_msg); gss_msg);
atomic_inc(&gss_msg->count); atomic_inc(&gss_msg->count);
gss_unhash_msg(gss_msg); gss_unhash_msg(gss_msg);
if (msg->errno == -ETIMEDOUT) { if (msg->errno == -ETIMEDOUT)
unsigned long now = jiffies; warn_gssd();
if (time_after(now, ratelimit)) {
printk(KERN_WARNING "RPC: AUTH_GSS upcall timed out.\n"
"Please check user daemon is running!\n");
ratelimit = now + 15*HZ;
}
}
gss_release_msg(gss_msg); gss_release_msg(gss_msg);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册