diff options
author | Benny Halevy <bhalevy@panasas.com> | 2011-10-19 22:12:58 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-10-24 04:24:27 -0400 |
commit | 5423732a71577f7860c56a4eea2c34ff162ddd73 (patch) | |
tree | 5d7af992af7ff974796288272ce2604dad8f1284 /fs/nfsd | |
parent | 8b289b2c2355c3bea75f3e499b4aa251a3191382 (diff) |
nfsd41: use SEQ4_STATUS_BACKCHANNEL_FAULT when cb_sequence is invalid
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 10 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 8 | ||||
-rw-r--r-- | fs/nfsd/state.h | 1 |
3 files changed, 18 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index de018ecadae6..7748d6a18d97 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -39,6 +39,8 @@ | |||
39 | 39 | ||
40 | #define NFSDDBG_FACILITY NFSDDBG_PROC | 40 | #define NFSDDBG_FACILITY NFSDDBG_PROC |
41 | 41 | ||
42 | static void nfsd4_mark_cb_fault(struct nfs4_client *, int reason); | ||
43 | |||
42 | #define NFSPROC4_CB_NULL 0 | 44 | #define NFSPROC4_CB_NULL 0 |
43 | #define NFSPROC4_CB_COMPOUND 1 | 45 | #define NFSPROC4_CB_COMPOUND 1 |
44 | 46 | ||
@@ -460,6 +462,8 @@ static int decode_cb_sequence4resok(struct xdr_stream *xdr, | |||
460 | */ | 462 | */ |
461 | status = 0; | 463 | status = 0; |
462 | out: | 464 | out: |
465 | if (status) | ||
466 | nfsd4_mark_cb_fault(cb->cb_clp, status); | ||
463 | return status; | 467 | return status; |
464 | out_overflow: | 468 | out_overflow: |
465 | print_overflow_msg(__func__, xdr); | 469 | print_overflow_msg(__func__, xdr); |
@@ -686,6 +690,12 @@ static void nfsd4_mark_cb_down(struct nfs4_client *clp, int reason) | |||
686 | warn_no_callback_path(clp, reason); | 690 | warn_no_callback_path(clp, reason); |
687 | } | 691 | } |
688 | 692 | ||
693 | static void nfsd4_mark_cb_fault(struct nfs4_client *clp, int reason) | ||
694 | { | ||
695 | clp->cl_cb_state = NFSD4_CB_FAULT; | ||
696 | warn_no_callback_path(clp, reason); | ||
697 | } | ||
698 | |||
689 | static void nfsd4_cb_probe_done(struct rpc_task *task, void *calldata) | 699 | static void nfsd4_cb_probe_done(struct rpc_task *task, void *calldata) |
690 | { | 700 | { |
691 | struct nfs4_client *clp = container_of(calldata, struct nfs4_client, cl_cb_null); | 701 | struct nfs4_client *clp = container_of(calldata, struct nfs4_client, cl_cb_null); |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index e8c2a3ec0e60..b51ad43b7ea1 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -1945,8 +1945,14 @@ out: | |||
1945 | 1945 | ||
1946 | nfsd4_get_session(cstate->session); | 1946 | nfsd4_get_session(cstate->session); |
1947 | atomic_inc(&clp->cl_refcount); | 1947 | atomic_inc(&clp->cl_refcount); |
1948 | if (clp->cl_cb_state == NFSD4_CB_DOWN) | 1948 | switch (clp->cl_cb_state) { |
1949 | case NFSD4_CB_DOWN: | ||
1949 | seq->status_flags |= SEQ4_STATUS_CB_PATH_DOWN; | 1950 | seq->status_flags |= SEQ4_STATUS_CB_PATH_DOWN; |
1951 | break; | ||
1952 | case NFSD4_CB_FAULT: | ||
1953 | seq->status_flags |= SEQ4_STATUS_BACKCHANNEL_FAULT; | ||
1954 | break; | ||
1955 | } | ||
1950 | } | 1956 | } |
1951 | kfree(conn); | 1957 | kfree(conn); |
1952 | spin_unlock(&client_lock); | 1958 | spin_unlock(&client_lock); |
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index 1a5820066040..a3cf38476a1b 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h | |||
@@ -258,6 +258,7 @@ struct nfs4_client { | |||
258 | #define NFSD4_CB_UP 0 | 258 | #define NFSD4_CB_UP 0 |
259 | #define NFSD4_CB_UNKNOWN 1 | 259 | #define NFSD4_CB_UNKNOWN 1 |
260 | #define NFSD4_CB_DOWN 2 | 260 | #define NFSD4_CB_DOWN 2 |
261 | #define NFSD4_CB_FAULT 3 | ||
261 | int cl_cb_state; | 262 | int cl_cb_state; |
262 | struct nfsd4_callback cl_cb_null; | 263 | struct nfsd4_callback cl_cb_null; |
263 | struct nfsd4_session *cl_cb_session; | 264 | struct nfsd4_session *cl_cb_session; |