SUNRPC: Fix an infinite loop in call_refresh/call_refreshresult
If the rpcauth_refreshcred() call returns an error other than EACCES, ENOMEM or ETIMEDOUT, we currently end up looping forever between call_refresh and call_refreshresult. The correct thing to do here is to exit on all errors except EAGAIN and ETIMEDOUT, for which case we retry 3 times, then return EACCES. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
3561d43fd2
commit
5fc43978a7
1 changed files with 15 additions and 9 deletions
|
@ -989,20 +989,26 @@ call_refreshresult(struct rpc_task *task)
|
||||||
dprint_status(task);
|
dprint_status(task);
|
||||||
|
|
||||||
task->tk_status = 0;
|
task->tk_status = 0;
|
||||||
task->tk_action = call_allocate;
|
task->tk_action = call_refresh;
|
||||||
if (status >= 0 && rpcauth_uptodatecred(task))
|
|
||||||
return;
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case -EACCES:
|
case 0:
|
||||||
rpc_exit(task, -EACCES);
|
if (rpcauth_uptodatecred(task))
|
||||||
return;
|
task->tk_action = call_allocate;
|
||||||
case -ENOMEM:
|
|
||||||
rpc_exit(task, -ENOMEM);
|
|
||||||
return;
|
return;
|
||||||
case -ETIMEDOUT:
|
case -ETIMEDOUT:
|
||||||
rpc_delay(task, 3*HZ);
|
rpc_delay(task, 3*HZ);
|
||||||
|
case -EAGAIN:
|
||||||
|
status = -EACCES;
|
||||||
|
if (!task->tk_cred_retry)
|
||||||
|
break;
|
||||||
|
task->tk_cred_retry--;
|
||||||
|
dprintk("RPC: %5u %s: retry refresh creds\n",
|
||||||
|
task->tk_pid, __func__);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
task->tk_action = call_refresh;
|
dprintk("RPC: %5u %s: refresh creds failed with error %d\n",
|
||||||
|
task->tk_pid, __func__, status);
|
||||||
|
rpc_exit(task, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue