Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

NFS: Fix an rcu deadlock in nfs_delegation_find_inode()



I was able to reproduce this pretty regularily using xfstests
generic/013 on NFS v4.0.

Reported-by: default avatarRoss Zwisler <Ross.Zwisler@linux.intel.com>
Fixes: 6c342655 (NFSv4: Return NFS4ERR_DELAY when a delegation recall fails due to igrab())
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 93b7f7ad
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -883,9 +883,11 @@ 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);
}