Commit d36ccb9c authored by Trond Myklebust's avatar Trond Myklebust

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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent f722406f
...@@ -563,11 +563,12 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred) ...@@ -563,11 +563,12 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred)
struct rpc_cred *cred = &gss_cred->gc_base; struct rpc_cred *cred = &gss_cred->gc_base;
struct gss_upcall_msg *gss_msg; struct gss_upcall_msg *gss_msg;
DEFINE_WAIT(wait); DEFINE_WAIT(wait);
int err = 0; int err;
dprintk("RPC: %s for uid %u\n", dprintk("RPC: %s for uid %u\n",
__func__, from_kuid(&init_user_ns, cred->cr_uid)); __func__, from_kuid(&init_user_ns, cred->cr_uid));
retry: retry:
err = 0;
gss_msg = gss_setup_upcall(gss_auth->client, gss_auth, cred); gss_msg = gss_setup_upcall(gss_auth->client, gss_auth, cred);
if (PTR_ERR(gss_msg) == -EAGAIN) { if (PTR_ERR(gss_msg) == -EAGAIN) {
err = wait_event_interruptible_timeout(pipe_version_waitqueue, err = wait_event_interruptible_timeout(pipe_version_waitqueue,
...@@ -576,7 +577,7 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred) ...@@ -576,7 +577,7 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred)
warn_gssd(); warn_gssd();
err = -EACCES; err = -EACCES;
} }
if (err) if (err < 0)
goto out; goto out;
goto retry; goto retry;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment