Skip to content

Commit c907e72

Browse files
olgakorn1Trond Myklebust
authored andcommitted
NFSv4.1: freeze the session table upon receiving NFS4ERR_BADSESSION
When the client received NFS4ERR_BADSESSION, it schedules recovery and start the state manager thread which in turn freezes the session table and does not allow for any new requests to use the no-longer valid session. However, it is possible that before the state manager thread runs, a new operation would use the released slot that received BADSESSION and was therefore not updated its sequence number. Such re-use of the slot can lead the application errors. Fixes: 5c44154 ("NFSv4.x: Handle bad/dead sessions correctly in nfs41_sequence_process()") Signed-off-by: Olga Kornievskaia <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 7f7ab33 commit c907e72

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/nfs/nfs4proc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ static int nfs41_sequence_process(struct rpc_task *task,
921921
out_noaction:
922922
return ret;
923923
session_recover:
924+
set_bit(NFS4_SLOT_TBL_DRAINING, &session->fc_slot_table.slot_tbl_state);
924925
nfs4_schedule_session_recovery(session, status);
925926
dprintk("%s ERROR: %d Reset session\n", __func__, status);
926927
nfs41_sequence_free_slot(res);

0 commit comments

Comments
 (0)