summaryrefslogtreecommitdiffstats
path: root/fs/nfs/delegation.h
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2014-11-11 00:43:56 +0100
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-11-12 23:19:04 +0100
commit869f9dfa4d6d57b79e0afc3af14772c2a023eeb1 (patch)
tree48adcdfacd4ac26a9faf36b8d31f9d2ed9f1217c /fs/nfs/delegation.h
parentNFSv4.1: nfs41_clear_delegation_stateid shouldn't trust NFS_DELEGATED_STATE (diff)
downloadlinux-869f9dfa4d6d57b79e0afc3af14772c2a023eeb1.tar.xz
linux-869f9dfa4d6d57b79e0afc3af14772c2a023eeb1.zip
NFSv4: Fix races between nfs_remove_bad_delegation() and delegation return
Any attempt to call nfs_remove_bad_delegation() while a delegation is being returned is currently a no-op. This means that we can end up looping forever in nfs_end_delegation_return() if something causes the delegation to be revoked. This patch adds a mechanism whereby the state recovery code can communicate to the delegation return code that the delegation is no longer valid and that it should not be used when reclaiming state. It also changes the return value for nfs4_handle_delegation_recall_error() to ensure that nfs_end_delegation_return() does not reattempt the lock reclaim before state recovery is done. http://lkml.kernel.org/r/CAN-5tyHwG=Cn2Q9KsHWadewjpTTy_K26ee+UnSvHvG4192p-Xw@mail.gmail.com Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/delegation.h')
-rw-r--r--fs/nfs/delegation.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/delegation.h b/fs/nfs/delegation.h
index 5c1cce39297f..e3c20a3ccc93 100644
--- a/fs/nfs/delegation.h
+++ b/fs/nfs/delegation.h
@@ -31,6 +31,7 @@ enum {
NFS_DELEGATION_RETURN_IF_CLOSED,
NFS_DELEGATION_REFERENCED,
NFS_DELEGATION_RETURNING,
+ NFS_DELEGATION_REVOKED,
};
int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct nfs_openres *res);