Loading fs/nfs/nfs4_fs.h +4 −1 Original line number Diff line number Diff line Loading @@ -45,10 +45,13 @@ enum nfs4_client_state { NFS4CLNT_RECLAIM_NOGRACE, NFS4CLNT_DELEGRETURN, NFS4CLNT_SESSION_RESET, NFS4CLNT_SESSION_DRAINING, NFS4CLNT_RECALL_SLOT, }; enum nfs4_session_state { NFS4_SESSION_DRAINING, }; /* * struct rpc_sequence ensures that RPC calls are sent in the exact * order that they appear on the list. Loading fs/nfs/nfs4proc.c +2 −2 Original line number Diff line number Diff line Loading @@ -356,7 +356,7 @@ static void nfs41_check_drain_session_complete(struct nfs4_session *ses) { struct rpc_task *task; if (!test_bit(NFS4CLNT_SESSION_DRAINING, &ses->clp->cl_state)) { if (!test_bit(NFS4_SESSION_DRAINING, &ses->session_state)) { task = rpc_wake_up_next(&ses->fc_slot_table.slot_tbl_waitq); if (task) rpc_task_set_priority(task, RPC_PRIORITY_PRIVILEGED); Loading Loading @@ -489,7 +489,7 @@ static int nfs41_setup_sequence(struct nfs4_session *session, tbl = &session->fc_slot_table; spin_lock(&tbl->slot_tbl_lock); if (test_bit(NFS4CLNT_SESSION_DRAINING, &session->clp->cl_state) && if (test_bit(NFS4_SESSION_DRAINING, &session->session_state) && !rpc_task_has_priority(task, RPC_PRIORITY_PRIVILEGED)) { /* * The state manager will wait until the slot table is empty. Loading fs/nfs/nfs4state.c +4 −2 Original line number Diff line number Diff line Loading @@ -145,7 +145,9 @@ static void nfs4_end_drain_session(struct nfs_client *clp) struct nfs4_session *ses = clp->cl_session; int max_slots; if (test_and_clear_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state)) { if (ses == NULL) return; if (test_and_clear_bit(NFS4_SESSION_DRAINING, &ses->session_state)) { spin_lock(&ses->fc_slot_table.slot_tbl_lock); max_slots = ses->fc_slot_table.max_slots; while (max_slots--) { Loading @@ -167,7 +169,7 @@ static int nfs4_begin_drain_session(struct nfs_client *clp) struct nfs4_slot_table *tbl = &ses->fc_slot_table; spin_lock(&tbl->slot_tbl_lock); set_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state); set_bit(NFS4_SESSION_DRAINING, &ses->session_state); if (tbl->highest_used_slotid != -1) { INIT_COMPLETION(ses->complete); spin_unlock(&tbl->slot_tbl_lock); Loading Loading
fs/nfs/nfs4_fs.h +4 −1 Original line number Diff line number Diff line Loading @@ -45,10 +45,13 @@ enum nfs4_client_state { NFS4CLNT_RECLAIM_NOGRACE, NFS4CLNT_DELEGRETURN, NFS4CLNT_SESSION_RESET, NFS4CLNT_SESSION_DRAINING, NFS4CLNT_RECALL_SLOT, }; enum nfs4_session_state { NFS4_SESSION_DRAINING, }; /* * struct rpc_sequence ensures that RPC calls are sent in the exact * order that they appear on the list. Loading
fs/nfs/nfs4proc.c +2 −2 Original line number Diff line number Diff line Loading @@ -356,7 +356,7 @@ static void nfs41_check_drain_session_complete(struct nfs4_session *ses) { struct rpc_task *task; if (!test_bit(NFS4CLNT_SESSION_DRAINING, &ses->clp->cl_state)) { if (!test_bit(NFS4_SESSION_DRAINING, &ses->session_state)) { task = rpc_wake_up_next(&ses->fc_slot_table.slot_tbl_waitq); if (task) rpc_task_set_priority(task, RPC_PRIORITY_PRIVILEGED); Loading Loading @@ -489,7 +489,7 @@ static int nfs41_setup_sequence(struct nfs4_session *session, tbl = &session->fc_slot_table; spin_lock(&tbl->slot_tbl_lock); if (test_bit(NFS4CLNT_SESSION_DRAINING, &session->clp->cl_state) && if (test_bit(NFS4_SESSION_DRAINING, &session->session_state) && !rpc_task_has_priority(task, RPC_PRIORITY_PRIVILEGED)) { /* * The state manager will wait until the slot table is empty. Loading
fs/nfs/nfs4state.c +4 −2 Original line number Diff line number Diff line Loading @@ -145,7 +145,9 @@ static void nfs4_end_drain_session(struct nfs_client *clp) struct nfs4_session *ses = clp->cl_session; int max_slots; if (test_and_clear_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state)) { if (ses == NULL) return; if (test_and_clear_bit(NFS4_SESSION_DRAINING, &ses->session_state)) { spin_lock(&ses->fc_slot_table.slot_tbl_lock); max_slots = ses->fc_slot_table.max_slots; while (max_slots--) { Loading @@ -167,7 +169,7 @@ static int nfs4_begin_drain_session(struct nfs_client *clp) struct nfs4_slot_table *tbl = &ses->fc_slot_table; spin_lock(&tbl->slot_tbl_lock); set_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state); set_bit(NFS4_SESSION_DRAINING, &ses->session_state); if (tbl->highest_used_slotid != -1) { INIT_COMPLETION(ses->complete); spin_unlock(&tbl->slot_tbl_lock); Loading