From: Trond Myklebust Date: Thu, 22 Sep 2016 17:39:01 +0000 (-0400) Subject: NFSv4.1: Don't recheck delegations that have already been checked X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=63d63cbf5e03f47c99baa0a1ba1c345fe426e3bd;p=linux-beck.git NFSv4.1: Don't recheck delegations that have already been checked Ensure we don't spam the server with test_stateid() calls for delegations that have already been checked. Signed-off-by: Trond Myklebust Tested-by: Oleg Drokin Signed-off-by: Anna Schumaker --- diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 083786aad83c..dfa46e49e356 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -2459,6 +2459,11 @@ static void nfs41_check_delegation_stateid(struct nfs4_state *state) 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);