aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/callback_proc.c
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2011-01-05 21:04:34 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-01-06 14:46:25 -0500
commit42acd021824578fa0eeb6eb58d457c23ec5dc9c0 (patch)
tree7affe8e1108373906eefcea00498df088b6dfccb /fs/nfs/callback_proc.c
parentece0de633c4d9106c39ea9f0db1638c42ead2541 (diff)
NFS add session back channel draining
Currently session draining only drains the fore channel. The back channel processing must also be drained. Use the back channel highest_slot_used to indicate that a callback is being processed by the callback thread. Move the session complete to be per channel. When the session is draininig, wait for any current back channel processing to complete and stop all new back channel processing by returning NFS4ERR_DELAY to the back channel client. Drain the back channel, then the fore channel. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/callback_proc.c')
-rw-r--r--fs/nfs/callback_proc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index b70e46da16fc..c1bead2f3e04 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -253,6 +253,12 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args,
253 if (clp == NULL) 253 if (clp == NULL)
254 goto out; 254 goto out;
255 255
256 /* state manager is resetting the session */
257 if (test_bit(NFS4_SESSION_DRAINING, &clp->cl_session->session_state)) {
258 status = NFS4ERR_DELAY;
259 goto out;
260 }
261
256 status = validate_seqid(&clp->cl_session->bc_slot_table, args); 262 status = validate_seqid(&clp->cl_session->bc_slot_table, args);
257 if (status) 263 if (status)
258 goto out; 264 goto out;
@@ -273,6 +279,7 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args,
273 res->csr_slotid = args->csa_slotid; 279 res->csr_slotid = args->csa_slotid;
274 res->csr_highestslotid = NFS41_BC_MAX_CALLBACKS - 1; 280 res->csr_highestslotid = NFS41_BC_MAX_CALLBACKS - 1;
275 res->csr_target_highestslotid = NFS41_BC_MAX_CALLBACKS - 1; 281 res->csr_target_highestslotid = NFS41_BC_MAX_CALLBACKS - 1;
282 nfs4_cb_take_slot(clp);
276 cps->clp = clp; /* put in nfs4_callback_compound */ 283 cps->clp = clp; /* put in nfs4_callback_compound */
277 284
278out: 285out: