Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Olga Kornievskaia and committed by
Anna Schumaker
0e3d3e5d fabbbee0

+3 -6
+3 -6
fs/nfs/nfs4proc.c
··· 2442 2442 } 2443 2443 2444 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 2448 rcu_read_unlock(); 2447 2449 nfs_finish_clear_delegation_stateid(state, &stateid); 2448 - return; 2449 - } 2450 - 2451 - if (!test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED, &delegation->flags)) { 2452 - rcu_read_unlock(); 2453 2450 return; 2454 2451 } 2455 2452