mirror of https://gitee.com/openkylin/linux.git
NFSv4: Fix an infinite looping problem with the nfs4_state_manager
Commit76db6d9500
(nfs41: add session setup to the state manager) introduces an infinite loop possibility in the NFSv4 state manager. By first checking nfs4_has_session() before clearing the NFS4CLNT_SESSION_SETUP flag, it allows for a situation where someone sets that flag, but it never gets cleared, and so the state manager loops. In fact commitc3fad1b1aa
(nfs41: add session reset to state manager) causes this to happen every time we get a network partition error. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Tested-by: Daniel J Blueman <daniel.blueman@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
2584e7986f
commit
7111dc7392
|
@ -1250,8 +1250,8 @@ static void nfs4_state_manager(struct nfs_client *clp)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* Initialize or reset the session */
|
/* Initialize or reset the session */
|
||||||
if (nfs4_has_session(clp) &&
|
if (test_and_clear_bit(NFS4CLNT_SESSION_SETUP, &clp->cl_state)
|
||||||
test_and_clear_bit(NFS4CLNT_SESSION_SETUP, &clp->cl_state)) {
|
&& nfs4_has_session(clp)) {
|
||||||
if (clp->cl_cons_state == NFS_CS_SESSION_INITING)
|
if (clp->cl_cons_state == NFS_CS_SESSION_INITING)
|
||||||
status = nfs4_initialize_session(clp);
|
status = nfs4_initialize_session(clp);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue