Commit e9d02cce authored by Trond Myklebust's avatar Trond Myklebust Committed by Luis Henriques

NFSv4: Don't report revoked delegations as valid in nfs_have_delegation()

BugLink: http://bugs.launchpad.net/bugs/1637510

commit b3f9e723 upstream.

If the delegation is revoked, then it can't be used for caching.

Fixes: 869f9dfa ("NFSv4: Fix races between nfs_remove_bad_delegation()...")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Tested-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 295a9be4
...@@ -51,6 +51,7 @@ nfs4_do_check_delegation(struct inode *inode, fmode_t flags, bool mark) ...@@ -51,6 +51,7 @@ nfs4_do_check_delegation(struct inode *inode, fmode_t flags, bool mark)
rcu_read_lock(); rcu_read_lock();
delegation = rcu_dereference(NFS_I(inode)->delegation); delegation = rcu_dereference(NFS_I(inode)->delegation);
if (delegation != NULL && (delegation->type & flags) == flags && if (delegation != NULL && (delegation->type & flags) == flags &&
!test_bit(NFS_DELEGATION_REVOKED, &delegation->flags) &&
!test_bit(NFS_DELEGATION_RETURNING, &delegation->flags)) { !test_bit(NFS_DELEGATION_RETURNING, &delegation->flags)) {
if (mark) if (mark)
nfs_mark_delegation_referenced(delegation); nfs_mark_delegation_referenced(delegation);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment