Skip to content

Commit

Permalink
NFS: Fix an rcu deadlock in nfs_delegation_find_inode()
Browse files Browse the repository at this point in the history
I was able to reproduce this pretty regularily using xfstests
generic/013 on NFS v4.0.

Reported-by: Ross Zwisler <[email protected]>
Fixes: 6c34265 (NFSv4: Return NFS4ERR_DELAY when a delegation recall fails due to igrab())
Signed-off-by: Anna Schumaker <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
amschuma-ntap authored and Trond Myklebust committed Jun 14, 2018
1 parent 93b7f7a commit d5681f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/nfs/delegation.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,10 @@ struct inode *nfs_delegation_find_inode(struct nfs_client *clp,
rcu_read_lock();
list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) {
res = nfs_delegation_find_inode_server(server, fhandle);
if (res != ERR_PTR(-ENOENT))
if (res != ERR_PTR(-ENOENT)) {
rcu_read_unlock();
return res;
}
}
rcu_read_unlock();
return ERR_PTR(-ENOENT);
Expand Down

0 comments on commit d5681f5

Please sign in to comment.