diff options
author | Alexandros Batsakis <batsakis@netapp.com> | 2009-12-14 21:27:56 -0800 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-12-15 13:55:18 -0500 |
commit | 689cf5c15baf603a8041565ff0bd0d65d1634fd7 (patch) | |
tree | 83fc6e666f0c099486cfcdb41b40c02d9fa163b7 /fs/nfs/nfs4state.c | |
parent | cf3b01b54880debb01ea7d471123da5887a7c2cb (diff) | |
download | linux-689cf5c15baf603a8041565ff0bd0d65d1634fd7.tar.gz linux-689cf5c15baf603a8041565ff0bd0d65d1634fd7.tar.bz2 linux-689cf5c15baf603a8041565ff0bd0d65d1634fd7.zip |
nfs: enforce FIFO ordering of operations trying to acquire slot
Signed-off-by: Alexandros Batsakis <batsakis@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r-- | fs/nfs/nfs4state.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index e76427e6346f..0e45075836b2 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -138,8 +138,22 @@ static int nfs41_setup_state_renewal(struct nfs_client *clp) static void nfs41_end_drain_session(struct nfs_client *clp, struct nfs4_session *ses) { - if (test_and_clear_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state)) - rpc_wake_up(&ses->fc_slot_table.slot_tbl_waitq); + int max_slots; + + if (test_and_clear_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state)) { + spin_lock(&ses->fc_slot_table.slot_tbl_lock); + max_slots = ses->fc_slot_table.max_slots; + while (max_slots--) { + struct rpc_task *task; + + task = rpc_wake_up_next(&ses->fc_slot_table. + slot_tbl_waitq); + if (!task) + break; + rpc_task_set_priority(task, RPC_PRIORITY_PRIVILEGED); + } + spin_unlock(&ses->fc_slot_table.slot_tbl_lock); + } } static int nfs41_begin_drain_session(struct nfs_client *clp, |