Commit 803e1864 authored by Anna Schumaker's avatar Anna Schumaker Committed by Trond Myklebust
Browse files

NFS: Don't immediately return directory delegations when disabled



The function nfs_inode_evict_delegation() immediately and synchronously
returns a delegation when called. This means we can't call it from
nfs4_have_delegation(), since that function could be called under a
lock. Instead we should mark the delegation for return and let the state
manager handle it for us.

Fixes: b6d2a520 ("NFS: Add a module option to disable directory delegations")
Signed-off-by: default avatarAnna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 60699ab7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ static int nfs4_do_check_delegation(struct inode *inode, fmode_t type,
int nfs4_have_delegation(struct inode *inode, fmode_t type, int flags)
{
	if (S_ISDIR(inode->i_mode) && !directory_delegations)
		nfs_inode_evict_delegation(inode);
		nfs4_inode_set_return_delegation_on_close(inode);
	return nfs4_do_check_delegation(inode, type, flags, true);
}