Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: b6d2a520f463 ("NFS: Add a module option to disable directory delegations")
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

authored by

Anna Schumaker and committed by
Trond Myklebust
803e1864 60699ab7

+1 -1
+1 -1
fs/nfs/delegation.c
··· 149 149 int nfs4_have_delegation(struct inode *inode, fmode_t type, int flags) 150 150 { 151 151 if (S_ISDIR(inode->i_mode) && !directory_delegations) 152 - nfs_inode_evict_delegation(inode); 152 + nfs4_inode_set_return_delegation_on_close(inode); 153 153 return nfs4_do_check_delegation(inode, type, flags, true); 154 154 } 155 155