mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
NFSv4: Don't report revoked delegations as valid in nfs_have_delegation()
commitb3f9e72390upstream. If the delegation is revoked, then it can't be used for caching. Fixes:869f9dfa4d("NFSv4: Fix races between nfs_remove_bad_delegation()...") 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a13ca3d638
commit
79e7e444ed
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user