Commit 444b6e91 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by J. Bruce Fields

nfsd: fix nfsd4_cb_recall_done error handling

For any error that is not EBADHANDLE or NFS4ERR_BAD_STATEID,
nfsd4_cb_recall_done first marks the connection down, then
retries until dl_retries hits zero, then marks the connection down
again and sets cb_done.  This changes the code to only retry
for EBADHANDLE or NFS4ERR_BAD_STATEID, and factors setting
cb_done into a single point in the function.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 70b28235
...@@ -874,24 +874,21 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata) ...@@ -874,24 +874,21 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata)
return; return;
switch (task->tk_status) { switch (task->tk_status) {
case 0: case 0:
cb->cb_done = true; break;
return;
case -EBADHANDLE: case -EBADHANDLE:
case -NFS4ERR_BAD_STATEID: case -NFS4ERR_BAD_STATEID:
/* Race: client probably got cb_recall /* Race: client probably got cb_recall
* before open reply granting delegation */ * before open reply granting delegation */
break;
default:
/* Network partition? */
nfsd4_mark_cb_down(clp, task->tk_status);
}
if (dp->dl_retries--) { if (dp->dl_retries--) {
rpc_delay(task, 2*HZ); rpc_delay(task, 2*HZ);
task->tk_status = 0; task->tk_status = 0;
rpc_restart_call_prepare(task); rpc_restart_call_prepare(task);
return; return;
} }
default:
/* Network partition? */
nfsd4_mark_cb_down(clp, task->tk_status); nfsd4_mark_cb_down(clp, task->tk_status);
}
cb->cb_done = true; cb->cb_done = true;
} }
......
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