summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2016-09-22 13:38:53 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2016-09-27 14:32:12 -0400
commitb3f9e7239074613aa6bdafa4caf7c104fe1e7276 (patch)
tree5a8f6235ea4a2d5d4cfe8ad756f0850b651f8eb3 /fs
parent7dc72d5f7a0ec97a53e126c46e2cbd2560757955 (diff)
downloadlinux-b3f9e7239074613aa6bdafa4caf7c104fe1e7276.tar.gz
linux-b3f9e7239074613aa6bdafa4caf7c104fe1e7276.tar.bz2
linux-b3f9e7239074613aa6bdafa4caf7c104fe1e7276.zip
NFSv4: Don't report revoked delegations as valid in nfs_have_delegation()
If the delegation is revoked, then it can't be used for caching. Fixes: 869f9dfa4d6d ("NFSv4: Fix races between nfs_remove_bad_delegation()...") Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Cc: stable@vger.kernel.org # v3.19+ 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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 322c2585bc34..86d2c748140b 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -51,6 +51,7 @@ nfs4_do_check_delegation(struct inode *inode, fmode_t flags, bool mark)
rcu_read_lock();
delegation = rcu_dereference(NFS_I(inode)->delegation);
if (delegation != NULL && (delegation->type & flags) == flags &&
+ !test_bit(NFS_DELEGATION_REVOKED, &delegation->flags) &&
!test_bit(NFS_DELEGATION_RETURNING, &delegation->flags)) {
if (mark)
nfs_mark_delegation_referenced(delegation);