diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2010-05-30 11:53:12 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2010-05-31 12:43:53 -0400 |
commit | 172c85dd5764d2766bfd68621e5b54e85c4a6cfa (patch) | |
tree | 960e6d16444e7d508516a443e51d7cd3cdaf65bb /fs | |
parent | 378b7d37f90399b7c34373a5925450529afb917b (diff) |
nfsd4: treat more recall errors as failures
If a recall fails for some unexpected reason, instead of ignoring it and
treating it like a success, it's safer to treat it as a failure,
preventing further delgation grants and returning CB_PATH_DOWN.
Also put put switches in a (two me) more logical order, with normal case
first.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 8a21db22bba4..ae917921ed41 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -667,7 +667,14 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata) | |||
667 | } | 667 | } |
668 | 668 | ||
669 | switch (task->tk_status) { | 669 | switch (task->tk_status) { |
670 | case -EIO: | 670 | case 0: |
671 | return; | ||
672 | case -EBADHANDLE: | ||
673 | case -NFS4ERR_BAD_STATEID: | ||
674 | /* Race: client probably got cb_recall | ||
675 | * before open reply granting delegation */ | ||
676 | break; | ||
677 | default: | ||
671 | /* Network partition? */ | 678 | /* Network partition? */ |
672 | atomic_set(&clp->cl_cb_set, 0); | 679 | atomic_set(&clp->cl_cb_set, 0); |
673 | warn_no_callback_path(clp, task->tk_status); | 680 | warn_no_callback_path(clp, task->tk_status); |
@@ -676,14 +683,6 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata) | |||
676 | nfsd4_cb_recall(dp); | 683 | nfsd4_cb_recall(dp); |
677 | return; | 684 | return; |
678 | } | 685 | } |
679 | case -EBADHANDLE: | ||
680 | case -NFS4ERR_BAD_STATEID: | ||
681 | /* Race: client probably got cb_recall | ||
682 | * before open reply granting delegation */ | ||
683 | break; | ||
684 | default: | ||
685 | /* success, or error we can't handle */ | ||
686 | return; | ||
687 | } | 686 | } |
688 | if (dp->dl_retries--) { | 687 | if (dp->dl_retries--) { |
689 | rpc_delay(task, 2*HZ); | 688 | rpc_delay(task, 2*HZ); |