diff options
| author | Jeff Layton <jlayton@redhat.com> | 2013-11-14 07:25:18 -0500 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-12-06 13:06:31 -0500 |
| commit | 89f842435c630f8426f414e6030bc2ffea0d6f81 (patch) | |
| tree | 5f377121615ac15042edbfb1337d569446863b21 /net/sunrpc/auth_gss | |
| parent | 4b9a445e3eeb8bd9278b1ae51c1b3a651e370cd6 (diff) | |
sunrpc: replace sunrpc_net->gssd_running flag with a more reliable check
Now that we have a more reliable method to tell if gssd is running, we
can replace the sn->gssd_running flag with a function that will query to
see if it's up and running.
There's also no need to attempt an upcall that we know will fail, so
just return -EACCES if gssd isn't running. Finally, fix the warn_gss()
message not to claim that that the upcall timed out since we don't
necesarily perform one now when gssd isn't running, and remove the
extraneous newline from the message.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth_gss')
| -rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 17 |
1 files changed, 7 insertions, 10 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 | } |
