Skip to content

Commit 9e8f324

Browse files
author
Trond Myklebust
committed
NFSv4: Check for delegation validity in nfs_start_delegation_return_locked()
Check that the delegation is still attached after taking the spin lock in nfs_start_delegation_return_locked(). Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent 8d3ca33 commit 9e8f324

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/nfs/delegation.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ nfs_start_delegation_return_locked(struct nfs_inode *nfsi)
307307
if (delegation == NULL)
308308
goto out;
309309
spin_lock(&delegation->lock);
310-
if (!test_and_set_bit(NFS_DELEGATION_RETURNING, &delegation->flags)) {
310+
if (delegation->inode &&
311+
!test_and_set_bit(NFS_DELEGATION_RETURNING, &delegation->flags)) {
311312
clear_bit(NFS_DELEGATION_RETURN_DELAYED, &delegation->flags);
312313
/* Refcount matched in nfs_end_delegation_return() */
313314
ret = nfs_get_delegation(delegation);

0 commit comments

Comments
 (0)