diff options
author | Olga Kornievskaia <kolga@netapp.com> | 2017-03-30 13:49:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-08 03:30:33 -0400 |
commit | 461bbb90942aea0fce1edfa271dee675cdec2029 (patch) | |
tree | ff470ab10b8b8b2d0052534dc25aa64d982a3aa7 | |
parent | 80df2b3e185e5e0e4a507d21119208658294f750 (diff) |
NFSv4.1 fix infinite loop on IO BAD_STATEID error
commit 0e3d3e5df07dcf8a50d96e0ecd6ab9a888f55dfc upstream.
Commit 63d63cbf5e03 "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: 63d63cbf5e03 ("NFSv4.1: Don't recheck delegations that have already been checked")
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/nfs/nfs4proc.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 1536aeb0abab..4e894d301c88 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -2532,17 +2532,14 @@ static void nfs41_check_delegation_stateid(struct nfs4_state *state) | |||
2532 | } | 2532 | } |
2533 | 2533 | ||
2534 | nfs4_stateid_copy(&stateid, &delegation->stateid); | 2534 | nfs4_stateid_copy(&stateid, &delegation->stateid); |
2535 | if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags)) { | 2535 | if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags) || |
2536 | !test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED, | ||
2537 | &delegation->flags)) { | ||
2536 | rcu_read_unlock(); | 2538 | rcu_read_unlock(); |
2537 | nfs_finish_clear_delegation_stateid(state, &stateid); | 2539 | nfs_finish_clear_delegation_stateid(state, &stateid); |
2538 | return; | 2540 | return; |
2539 | } | 2541 | } |
2540 | 2542 | ||
2541 | if (!test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED, &delegation->flags)) { | ||
2542 | rcu_read_unlock(); | ||
2543 | return; | ||
2544 | } | ||
2545 | |||
2546 | cred = get_rpccred(delegation->cred); | 2543 | cred = get_rpccred(delegation->cred); |
2547 | rcu_read_unlock(); | 2544 | rcu_read_unlock(); |
2548 | status = nfs41_test_and_free_expired_stateid(server, &stateid, cred); | 2545 | status = nfs41_test_and_free_expired_stateid(server, &stateid, cred); |