aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorOlga Kornievskaia <kolga@netapp.com>2017-03-30 13:49:03 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2017-03-31 13:30:21 -0400
commit0e3d3e5df07dcf8a50d96e0ecd6ab9a888f55dfc (patch)
treed10cf2a0cc9032cbeb4aae28e01a61fbfa4f2f21 /fs/nfs/nfs4proc.c
parentfabbbee0eb0f4b763576ac1e2db4fc3bf6dcc0cc (diff)
NFSv4.1 fix infinite loop on IO BAD_STATEID error
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> Cc: stable@vger.kernel.org # 4.9+ Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index c780d98035cc..201ca3f2c4ba 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2442,17 +2442,14 @@ static void nfs41_check_delegation_stateid(struct nfs4_state *state)
2442 } 2442 }
2443 2443
2444 nfs4_stateid_copy(&stateid, &delegation->stateid); 2444 nfs4_stateid_copy(&stateid, &delegation->stateid);
2445 if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags)) { 2445 if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags) ||
2446 !test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED,
2447 &delegation->flags)) {
2446 rcu_read_unlock(); 2448 rcu_read_unlock();
2447 nfs_finish_clear_delegation_stateid(state, &stateid); 2449 nfs_finish_clear_delegation_stateid(state, &stateid);
2448 return; 2450 return;
2449 } 2451 }
2450 2452
2451 if (!test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED, &delegation->flags)) {
2452 rcu_read_unlock();
2453 return;
2454 }
2455
2456 cred = get_rpccred(delegation->cred); 2453 cred = get_rpccred(delegation->cred);
2457 rcu_read_unlock(); 2454 rcu_read_unlock();
2458 status = nfs41_test_and_free_expired_stateid(server, &stateid, cred); 2455 status = nfs41_test_and_free_expired_stateid(server, &stateid, cred);