aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2009-12-04 15:55:39 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-12-04 15:55:39 -0500
commit691daf3b0c410c8bcab6735796be03ea446e1924 (patch)
tree989669b839146bcc36dc2b059b5c188dd901987d /fs/nfs/nfs4proc.c
parentea028ac92541ac30bf202ed94cb53eec2ea0c9d6 (diff)
nfs41: drain session cleanup
Do not wake up the next slot_tbl_waitq task in nfs4_free_slot because we may be draining the slot. Either signal the state manager that the session is drained (the state manager wakes up tasks) OR wake up the next task. In nfs41_sequence_done, the slot dereference is only needed in the sequence operation success case. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index c1bc9cad5e85..a0f73e99ff3d 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -336,7 +336,6 @@ nfs4_free_slot(struct nfs4_slot_table *tbl, u8 free_slotid)
336 else 336 else
337 tbl->highest_used_slotid = -1; 337 tbl->highest_used_slotid = -1;
338 } 338 }
339 rpc_wake_up_next(&tbl->slot_tbl_waitq);
340 spin_unlock(&tbl->slot_tbl_lock); 339 spin_unlock(&tbl->slot_tbl_lock);
341 dprintk("%s: free_slotid %u highest_used_slotid %d\n", __func__, 340 dprintk("%s: free_slotid %u highest_used_slotid %d\n", __func__,
342 free_slotid, tbl->highest_used_slotid); 341 free_slotid, tbl->highest_used_slotid);
@@ -353,14 +352,13 @@ void nfs41_sequence_free_slot(const struct nfs_client *clp,
353 } 352 }
354 tbl = &clp->cl_session->fc_slot_table; 353 tbl = &clp->cl_session->fc_slot_table;
355 if (res->sr_slotid == NFS4_MAX_SLOT_TABLE) { 354 if (res->sr_slotid == NFS4_MAX_SLOT_TABLE) {
356 dprintk("%s: No slot\n", __func__);
357 /* just wake up the next guy waiting since 355 /* just wake up the next guy waiting since
358 * we may have not consumed a slot after all */ 356 * we may have not consumed a slot after all */
359 rpc_wake_up_next(&tbl->slot_tbl_waitq); 357 dprintk("%s: No slot\n", __func__);
360 return; 358 } else {
359 nfs4_free_slot(tbl, res->sr_slotid);
360 res->sr_slotid = NFS4_MAX_SLOT_TABLE;
361 } 361 }
362 nfs4_free_slot(tbl, res->sr_slotid);
363 res->sr_slotid = NFS4_MAX_SLOT_TABLE;
364 362
365 /* Signal state manager thread if session is drained */ 363 /* Signal state manager thread if session is drained */
366 if (test_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state)) { 364 if (test_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state)) {
@@ -370,6 +368,8 @@ void nfs41_sequence_free_slot(const struct nfs_client *clp,
370 complete(&clp->cl_session->complete); 368 complete(&clp->cl_session->complete);
371 } 369 }
372 spin_unlock(&tbl->slot_tbl_lock); 370 spin_unlock(&tbl->slot_tbl_lock);
371 } else {
372 rpc_wake_up_next(&tbl->slot_tbl_waitq);
373 } 373 }
374} 374}
375 375
@@ -394,10 +394,10 @@ static void nfs41_sequence_done(struct nfs_client *clp,
394 if (res->sr_slotid == NFS4_MAX_SLOT_TABLE) 394 if (res->sr_slotid == NFS4_MAX_SLOT_TABLE)
395 goto out; 395 goto out;
396 396
397 tbl = &clp->cl_session->fc_slot_table; 397 /* Check the SEQUENCE operation status */
398 slot = tbl->slots + res->sr_slotid;
399
400 if (res->sr_status == 0) { 398 if (res->sr_status == 0) {
399 tbl = &clp->cl_session->fc_slot_table;
400 slot = tbl->slots + res->sr_slotid;
401 /* Update the slot's sequence and clientid lease timer */ 401 /* Update the slot's sequence and clientid lease timer */
402 ++slot->seq_nr; 402 ++slot->seq_nr;
403 timestamp = res->sr_renewal_time; 403 timestamp = res->sr_renewal_time;