diff options
author | Scott Mayhew <smayhew@redhat.com> | 2019-05-02 13:32:12 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2019-05-03 11:01:38 -0400 |
commit | 1c73b9d24f804935dbb06527b768f8f068c93472 (patch) | |
tree | 6411712007ecbdf5fc7f876539619902d01e49cd | |
parent | 5926459e7c897ee348c134f44da520c8bf234b05 (diff) |
nfsd: update callback done processing
Instead of having the convention where individual nfsd4_callback_ops->done
operations return -1 to indicate the callback path is down, move the check
to nfsd4_cb_done. Only mark the callback path down on transport-level
errors, not NFS-level errors.
The existing logic causes the server to set SEQ4_STATUS_CB_PATH_DOWN
just because the client returned an error to a CB_RECALL for a
delegation that the client had already done a FREE_STATEID for. But
clearly that error doesn't mean that there's anything wrong with the
backchannel.
Additionally, handle NFS4ERR_DELAY in nfsd4_cb_recall_done. The client
returns NFS4ERR_DELAY if it is already in the process of returning the
delegation.
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r-- | fs/nfsd/nfs4callback.c | 9 | ||||
-rw-r--r-- | fs/nfsd/nfs4layouts.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 5 |
3 files changed, 10 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 7caa3801ce72..b9cbd7189d74 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -1122,10 +1122,11 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata) | |||
1122 | rpc_restart_call_prepare(task); | 1122 | rpc_restart_call_prepare(task); |
1123 | return; | 1123 | return; |
1124 | case 1: | 1124 | case 1: |
1125 | break; | 1125 | switch (task->tk_status) { |
1126 | case -1: | 1126 | case -EIO: |
1127 | /* Network partition? */ | 1127 | case -ETIMEDOUT: |
1128 | nfsd4_mark_cb_down(clp, task->tk_status); | 1128 | nfsd4_mark_cb_down(clp, task->tk_status); |
1129 | } | ||
1129 | break; | 1130 | break; |
1130 | default: | 1131 | default: |
1131 | BUG(); | 1132 | BUG(); |
diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c index 44517fb5c0de..a79e24b79095 100644 --- a/fs/nfsd/nfs4layouts.c +++ b/fs/nfsd/nfs4layouts.c | |||
@@ -693,7 +693,7 @@ nfsd4_cb_layout_done(struct nfsd4_callback *cb, struct rpc_task *task) | |||
693 | ops->fence_client(ls); | 693 | ops->fence_client(ls); |
694 | else | 694 | else |
695 | nfsd4_cb_layout_fail(ls); | 695 | nfsd4_cb_layout_fail(ls); |
696 | return -1; | 696 | return 1; |
697 | case -NFS4ERR_NOMATCHING_LAYOUT: | 697 | case -NFS4ERR_NOMATCHING_LAYOUT: |
698 | trace_nfsd_layout_recall_done(&ls->ls_stid.sc_stateid); | 698 | trace_nfsd_layout_recall_done(&ls->ls_stid.sc_stateid); |
699 | task->tk_status = 0; | 699 | task->tk_status = 0; |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 8078314981f5..dfe4b596c2e5 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -3970,6 +3970,9 @@ static int nfsd4_cb_recall_done(struct nfsd4_callback *cb, | |||
3970 | switch (task->tk_status) { | 3970 | switch (task->tk_status) { |
3971 | case 0: | 3971 | case 0: |
3972 | return 1; | 3972 | return 1; |
3973 | case -NFS4ERR_DELAY: | ||
3974 | rpc_delay(task, 2 * HZ); | ||
3975 | return 0; | ||
3973 | case -EBADHANDLE: | 3976 | case -EBADHANDLE: |
3974 | case -NFS4ERR_BAD_STATEID: | 3977 | case -NFS4ERR_BAD_STATEID: |
3975 | /* | 3978 | /* |
@@ -3982,7 +3985,7 @@ static int nfsd4_cb_recall_done(struct nfsd4_callback *cb, | |||
3982 | } | 3985 | } |
3983 | /*FALLTHRU*/ | 3986 | /*FALLTHRU*/ |
3984 | default: | 3987 | default: |
3985 | return -1; | 3988 | return 1; |
3986 | } | 3989 | } |
3987 | } | 3990 | } |
3988 | 3991 | ||