Commit fa011dbc authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] nfsd4: use sync rpc for delegation recall

Use a synchronous rpc for the delegation recall.  This is simpler and
avoids putting rpciod to sleep for 2 seconds on retries.
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 35440953
...@@ -495,17 +495,16 @@ nfs4_cb_null(struct rpc_task *task) ...@@ -495,17 +495,16 @@ nfs4_cb_null(struct rpc_task *task)
* Called with dp->dl_count incremented * Called with dp->dl_count incremented
*/ */
static void static void
nfs4_cb_recall_done(struct rpc_task *task) nfs4_cb_recall_done(struct nfs4_cb_recall *cbr, int status)
{ {
struct nfs4_cb_recall *cbr = (struct nfs4_cb_recall *)task->tk_calldata;
struct nfs4_delegation *dp = cbr->cbr_dp; struct nfs4_delegation *dp = cbr->cbr_dp;
/* all is well... */ /* all is well... */
if (task->tk_status == 0) if (status == 0)
goto out; goto out;
/* network partition, retry nfsd4_cb_recall once. */ /* network partition, retry nfsd4_cb_recall once. */
if (task->tk_status == -EIO) { if (status == -EIO) {
if (atomic_read(&dp->dl_recall_cnt) == 0) if (atomic_read(&dp->dl_recall_cnt) == 0)
goto retry; goto retry;
else else
...@@ -517,7 +516,7 @@ nfs4_cb_recall_done(struct rpc_task *task) ...@@ -517,7 +516,7 @@ nfs4_cb_recall_done(struct rpc_task *task)
* Client may have received recall prior to delegation. retry recall * Client may have received recall prior to delegation. retry recall
* once. * once.
*/ */
if ((task->tk_status == -EBADHANDLE) || (task->tk_status == -NFS4ERR_BAD_STATEID)){ if ((status == -EBADHANDLE) || (status == -NFS4ERR_BAD_STATEID)){
if (atomic_read(&dp->dl_recall_cnt) == 0) if (atomic_read(&dp->dl_recall_cnt) == 0)
goto retry; goto retry;
} }
...@@ -570,10 +569,11 @@ nfsd4_cb_recall(struct nfs4_delegation *dp) ...@@ -570,10 +569,11 @@ nfsd4_cb_recall(struct nfs4_delegation *dp)
cbr->cbr_trunc = 0; /* XXX need to implement truncate optimization */ cbr->cbr_trunc = 0; /* XXX need to implement truncate optimization */
cbr->cbr_dp = dp; cbr->cbr_dp = dp;
if ((status = rpc_call_async(clnt, &msg, RPC_TASK_SOFT, status = rpc_call_sync(clnt, &msg, RPC_TASK_SOFT);
nfs4_cb_recall_done, cbr ))) if (status)
dprintk("NFSD: recall_delegation: rpc_call_async failed %d\n", dprintk("NFSD: recall_delegation: rpc_call_async failed %d\n",
status); status);
nfs4_cb_recall_done(cbr, status);
put_rpccred(msg.rpc_cred); put_rpccred(msg.rpc_cred);
return; return;
} }
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