summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAnna Schumaker <anna.schumaker@oracle.com>2026-01-09 15:41:14 -0500
committerTrond Myklebust <trond.myklebust@hammerspace.com>2026-01-12 11:50:22 -0500
commit803e18641fd444a614415711a5af53dcde21104b (patch)
tree634a09f2a06631cf417b3082c5e9e66c1ff8f752 /fs
parent60699ab7cbf0a4eb19929cce243002b39c67917d (diff)
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/delegation.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index c9fa4c1f68fc..8a3857a49d84 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -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);
}