summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2016-09-22 13:39:06 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2016-09-27 14:34:31 -0400
commit059b43e9744efe5b6f8e83516d2a0e813bfaee70 (patch)
treebc821075e4c81fbd232a650d8ffa76beb6adf139 /fs
parent26d36301bd653df6481fd38f3e1435a1f15e56d1 (diff)
downloadop-kernel-dev-059b43e9744efe5b6f8e83516d2a0e813bfaee70.zip
op-kernel-dev-059b43e9744efe5b6f8e83516d2a0e813bfaee70.tar.gz
NFSv4: Ensure we don't re-test revoked and freed stateids
This fixes a potential infinite loop in nfs_reap_expired_delegations. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Tested-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/delegation.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 0ffead2..484f147 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -656,6 +656,7 @@ static void nfs_mark_delegation_revoked(struct nfs_server *server,
struct nfs_delegation *delegation)
{
set_bit(NFS_DELEGATION_REVOKED, &delegation->flags);
+ delegation->stateid.type = NFS4_INVALID_STATEID_TYPE;
nfs_mark_return_delegation(server, delegation);
}
@@ -894,6 +895,8 @@ static inline bool nfs4_server_rebooted(const struct nfs_client *clp)
static void nfs_mark_test_expired_delegation(struct nfs_server *server,
struct nfs_delegation *delegation)
{
+ if (delegation->stateid.type == NFS4_INVALID_STATEID_TYPE)
+ return;
clear_bit(NFS_DELEGATION_NEED_RECLAIM, &delegation->flags);
set_bit(NFS_DELEGATION_TEST_EXPIRED, &delegation->flags);
set_bit(NFS4CLNT_DELEGATION_EXPIRED, &server->nfs_client->cl_state);
OpenPOWER on IntegriCloud