Commit 0e3d3e5d authored by Olga Kornievskaia's avatar Olga Kornievskaia Committed by Anna Schumaker

NFSv4.1 fix infinite loop on IO BAD_STATEID error

Commit 63d63cbf "NFSv4.1: Don't recheck delegations that
have already been checked" introduced a regression where when a
client received BAD_STATEID error it would not send any TEST_STATEID
and instead go into an infinite loop of resending the IO that caused
the BAD_STATEID.

Fixes: 63d63cbf ("NFSv4.1: Don't recheck delegations that have already been checked")
Signed-off-by: default avatarOlga Kornievskaia <kolga@netapp.com>
Cc: stable@vger.kernel.org # 4.9+
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent fabbbee0
......@@ -2442,17 +2442,14 @@ static void nfs41_check_delegation_stateid(struct nfs4_state *state)
}
nfs4_stateid_copy(&stateid, &delegation->stateid);
if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags)) {
if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags) ||
!test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED,
&delegation->flags)) {
rcu_read_unlock();
nfs_finish_clear_delegation_stateid(state, &stateid);
return;
}
if (!test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED, &delegation->flags)) {
rcu_read_unlock();
return;
}
cred = get_rpccred(delegation->cred);
rcu_read_unlock();
status = nfs41_test_and_free_expired_stateid(server, &stateid, cred);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment