aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4callback.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfs4callback.c')
-rw-r--r--fs/nfsd/nfs4callback.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 02eb4edf0ece..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
42static 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
@@ -351,7 +353,7 @@ static void encode_cb_recall4args(struct xdr_stream *xdr,
351 __be32 *p; 353 __be32 *p;
352 354
353 encode_nfs_cb_opnum4(xdr, OP_CB_RECALL); 355 encode_nfs_cb_opnum4(xdr, OP_CB_RECALL);
354 encode_stateid4(xdr, &dp->dl_stateid); 356 encode_stateid4(xdr, &dp->dl_stid.sc_stateid);
355 357
356 p = xdr_reserve_space(xdr, 4); 358 p = xdr_reserve_space(xdr, 4);
357 *p++ = xdr_zero; /* truncate */ 359 *p++ = xdr_zero; /* truncate */
@@ -460,6 +462,8 @@ static int decode_cb_sequence4resok(struct xdr_stream *xdr,
460 */ 462 */
461 status = 0; 463 status = 0;
462out: 464out:
465 if (status)
466 nfsd4_mark_cb_fault(cb->cb_clp, status);
463 return status; 467 return status;
464out_overflow: 468out_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
693static 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
689static void nfsd4_cb_probe_done(struct rpc_task *task, void *calldata) 699static 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);
@@ -787,7 +797,7 @@ static void nfsd4_cb_prepare(struct rpc_task *task, void *calldata)
787{ 797{
788 struct nfsd4_callback *cb = calldata; 798 struct nfsd4_callback *cb = calldata;
789 struct nfs4_delegation *dp = container_of(cb, struct nfs4_delegation, dl_recall); 799 struct nfs4_delegation *dp = container_of(cb, struct nfs4_delegation, dl_recall);
790 struct nfs4_client *clp = dp->dl_client; 800 struct nfs4_client *clp = dp->dl_stid.sc_client;
791 u32 minorversion = clp->cl_minorversion; 801 u32 minorversion = clp->cl_minorversion;
792 802
793 cb->cb_minorversion = minorversion; 803 cb->cb_minorversion = minorversion;
@@ -809,7 +819,7 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata)
809{ 819{
810 struct nfsd4_callback *cb = calldata; 820 struct nfsd4_callback *cb = calldata;
811 struct nfs4_delegation *dp = container_of(cb, struct nfs4_delegation, dl_recall); 821 struct nfs4_delegation *dp = container_of(cb, struct nfs4_delegation, dl_recall);
812 struct nfs4_client *clp = dp->dl_client; 822 struct nfs4_client *clp = dp->dl_stid.sc_client;
813 823
814 dprintk("%s: minorversion=%d\n", __func__, 824 dprintk("%s: minorversion=%d\n", __func__,
815 clp->cl_minorversion); 825 clp->cl_minorversion);
@@ -832,7 +842,7 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata)
832{ 842{
833 struct nfsd4_callback *cb = calldata; 843 struct nfsd4_callback *cb = calldata;
834 struct nfs4_delegation *dp = container_of(cb, struct nfs4_delegation, dl_recall); 844 struct nfs4_delegation *dp = container_of(cb, struct nfs4_delegation, dl_recall);
835 struct nfs4_client *clp = dp->dl_client; 845 struct nfs4_client *clp = dp->dl_stid.sc_client;
836 struct rpc_clnt *current_rpc_client = clp->cl_cb_client; 846 struct rpc_clnt *current_rpc_client = clp->cl_cb_client;
837 847
838 nfsd4_cb_done(task, calldata); 848 nfsd4_cb_done(task, calldata);
@@ -1006,7 +1016,7 @@ void nfsd4_do_callback_rpc(struct work_struct *w)
1006void nfsd4_cb_recall(struct nfs4_delegation *dp) 1016void nfsd4_cb_recall(struct nfs4_delegation *dp)
1007{ 1017{
1008 struct nfsd4_callback *cb = &dp->dl_recall; 1018 struct nfsd4_callback *cb = &dp->dl_recall;
1009 struct nfs4_client *clp = dp->dl_client; 1019 struct nfs4_client *clp = dp->dl_stid.sc_client;
1010 1020
1011 dp->dl_retries = 1; 1021 dp->dl_retries = 1;
1012 cb->cb_op = dp; 1022 cb->cb_op = dp;