aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-05-15 13:46:33 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-05-15 13:49:58 -0400
commitd36ccb9cec22a09a12d9ef8234d634f840d7ae4b (patch)
tree98c0a98a69aa2c7cf8ba99c92b0de8594da9b385 /net/sunrpc/auth_gss
parentf722406faae2d073cc1d01063d1123c35425939e (diff)
SUNRPC: Fix a bug in gss_create_upcall
If wait_event_interruptible_timeout() is successful, it returns the number of seconds remaining until the timeout. In that case, we should be retrying the upcall. 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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 7da6b457f66a..f17f3c581ff4 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -563,11 +563,12 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred)
563 struct rpc_cred *cred = &gss_cred->gc_base; 563 struct rpc_cred *cred = &gss_cred->gc_base;
564 struct gss_upcall_msg *gss_msg; 564 struct gss_upcall_msg *gss_msg;
565 DEFINE_WAIT(wait); 565 DEFINE_WAIT(wait);
566 int err = 0; 566 int err;
567 567
568 dprintk("RPC: %s for uid %u\n", 568 dprintk("RPC: %s for uid %u\n",
569 __func__, from_kuid(&init_user_ns, cred->cr_uid)); 569 __func__, from_kuid(&init_user_ns, cred->cr_uid));
570retry: 570retry:
571 err = 0;
571 gss_msg = gss_setup_upcall(gss_auth->client, gss_auth, cred); 572 gss_msg = gss_setup_upcall(gss_auth->client, gss_auth, cred);
572 if (PTR_ERR(gss_msg) == -EAGAIN) { 573 if (PTR_ERR(gss_msg) == -EAGAIN) {
573 err = wait_event_interruptible_timeout(pipe_version_waitqueue, 574 err = wait_event_interruptible_timeout(pipe_version_waitqueue,
@@ -576,7 +577,7 @@ retry:
576 warn_gssd(); 577 warn_gssd();
577 err = -EACCES; 578 err = -EACCES;
578 } 579 }
579 if (err) 580 if (err < 0)
580 goto out; 581 goto out;
581 goto retry; 582 goto retry;
582 } 583 }