diff options
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 17 | ||||
-rw-r--r-- | net/sunrpc/netns.h | 2 | ||||
-rw-r--r-- | net/sunrpc/rpc_pipe.c | 14 |
3 files changed, 17 insertions, 16 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 42fdfc634e56..0a2aee060f9f 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -536,8 +536,7 @@ static void warn_gssd(void) | |||
536 | unsigned long now = jiffies; | 536 | unsigned long now = jiffies; |
537 | 537 | ||
538 | if (time_after(now, ratelimit)) { | 538 | if (time_after(now, ratelimit)) { |
539 | printk(KERN_WARNING "RPC: AUTH_GSS upcall timed out.\n" | 539 | pr_warn("RPC: AUTH_GSS upcall failed. Please check user daemon is running.\n"); |
540 | "Please check user daemon is running.\n"); | ||
541 | ratelimit = now + 15*HZ; | 540 | ratelimit = now + 15*HZ; |
542 | } | 541 | } |
543 | } | 542 | } |
@@ -600,7 +599,6 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred) | |||
600 | struct rpc_pipe *pipe; | 599 | struct rpc_pipe *pipe; |
601 | struct rpc_cred *cred = &gss_cred->gc_base; | 600 | struct rpc_cred *cred = &gss_cred->gc_base; |
602 | struct gss_upcall_msg *gss_msg; | 601 | struct gss_upcall_msg *gss_msg; |
603 | unsigned long timeout; | ||
604 | DEFINE_WAIT(wait); | 602 | DEFINE_WAIT(wait); |
605 | int err; | 603 | int err; |
606 | 604 | ||
@@ -608,17 +606,16 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred) | |||
608 | __func__, from_kuid(&init_user_ns, cred->cr_uid)); | 606 | __func__, from_kuid(&init_user_ns, cred->cr_uid)); |
609 | retry: | 607 | retry: |
610 | err = 0; | 608 | err = 0; |
611 | /* Default timeout is 15s unless we know that gssd is not running */ | 609 | /* if gssd is down, just skip upcalling altogether */ |
612 | timeout = 15 * HZ; | 610 | if (!gssd_running(net)) { |
613 | if (!sn->gssd_running) | 611 | warn_gssd(); |
614 | timeout = HZ >> 2; | 612 | return -EACCES; |
613 | } | ||
615 | gss_msg = gss_setup_upcall(gss_auth, cred); | 614 | gss_msg = gss_setup_upcall(gss_auth, cred); |
616 | if (PTR_ERR(gss_msg) == -EAGAIN) { | 615 | if (PTR_ERR(gss_msg) == -EAGAIN) { |
617 | err = wait_event_interruptible_timeout(pipe_version_waitqueue, | 616 | err = wait_event_interruptible_timeout(pipe_version_waitqueue, |
618 | sn->pipe_version >= 0, timeout); | 617 | sn->pipe_version >= 0, 15 * HZ); |
619 | if (sn->pipe_version < 0) { | 618 | if (sn->pipe_version < 0) { |
620 | if (err == 0) | ||
621 | sn->gssd_running = 0; | ||
622 | warn_gssd(); | 619 | warn_gssd(); |
623 | err = -EACCES; | 620 | err = -EACCES; |
624 | } | 621 | } |
diff --git a/net/sunrpc/netns.h b/net/sunrpc/netns.h index 8a8e841d1547..94e506f9d72b 100644 --- a/net/sunrpc/netns.h +++ b/net/sunrpc/netns.h | |||
@@ -33,8 +33,6 @@ struct sunrpc_net { | |||
33 | int pipe_version; | 33 | int pipe_version; |
34 | atomic_t pipe_users; | 34 | atomic_t pipe_users; |
35 | struct proc_dir_entry *use_gssp_proc; | 35 | struct proc_dir_entry *use_gssp_proc; |
36 | |||
37 | unsigned int gssd_running; | ||
38 | }; | 36 | }; |
39 | 37 | ||
40 | extern int sunrpc_net_id; | 38 | extern int sunrpc_net_id; |
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index c23458b464c4..5cd7ad1225a3 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
@@ -216,14 +216,11 @@ rpc_destroy_inode(struct inode *inode) | |||
216 | static int | 216 | static int |
217 | rpc_pipe_open(struct inode *inode, struct file *filp) | 217 | rpc_pipe_open(struct inode *inode, struct file *filp) |
218 | { | 218 | { |
219 | struct net *net = inode->i_sb->s_fs_info; | ||
220 | struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); | ||
221 | struct rpc_pipe *pipe; | 219 | struct rpc_pipe *pipe; |
222 | int first_open; | 220 | int first_open; |
223 | int res = -ENXIO; | 221 | int res = -ENXIO; |
224 | 222 | ||
225 | mutex_lock(&inode->i_mutex); | 223 | mutex_lock(&inode->i_mutex); |
226 | sn->gssd_running = 1; | ||
227 | pipe = RPC_I(inode)->pipe; | 224 | pipe = RPC_I(inode)->pipe; |
228 | if (pipe == NULL) | 225 | if (pipe == NULL) |
229 | goto out; | 226 | goto out; |
@@ -1222,7 +1219,6 @@ int rpc_pipefs_init_net(struct net *net) | |||
1222 | return PTR_ERR(sn->gssd_dummy); | 1219 | return PTR_ERR(sn->gssd_dummy); |
1223 | 1220 | ||
1224 | mutex_init(&sn->pipefs_sb_lock); | 1221 | mutex_init(&sn->pipefs_sb_lock); |
1225 | sn->gssd_running = 1; | ||
1226 | sn->pipe_version = -1; | 1222 | sn->pipe_version = -1; |
1227 | return 0; | 1223 | return 0; |
1228 | } | 1224 | } |
@@ -1376,6 +1372,16 @@ err_depopulate: | |||
1376 | return err; | 1372 | return err; |
1377 | } | 1373 | } |
1378 | 1374 | ||
1375 | bool | ||
1376 | gssd_running(struct net *net) | ||
1377 | { | ||
1378 | struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); | ||
1379 | struct rpc_pipe *pipe = sn->gssd_dummy; | ||
1380 | |||
1381 | return pipe->nreaders || pipe->nwriters; | ||
1382 | } | ||
1383 | EXPORT_SYMBOL_GPL(gssd_running); | ||
1384 | |||
1379 | static struct dentry * | 1385 | static struct dentry * |
1380 | rpc_mount(struct file_system_type *fs_type, | 1386 | rpc_mount(struct file_system_type *fs_type, |
1381 | int flags, const char *dev_name, void *data) | 1387 | int flags, const char *dev_name, void *data) |