From: Trond Myklebust Date: Wed, 13 Dec 2006 21:43:13 +0000 (-0500) Subject: NFSv4: Add lockdep checks to nfs4_wait_clnt_recover() X-Git-Tag: v2.6.21-rc1~286 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e148582e10a2c1a23dfc09210df4a18bc6cca4e9;p=linux-2.6 NFSv4: Add lockdep checks to nfs4_wait_clnt_recover() Attempt to detect deadlocks due to caller holding locks on clp->cl_sem Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 35bfcced2c..1712d0360e 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -2711,11 +2711,15 @@ static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp) might_sleep(); + rwsem_acquire(&clp->cl_sem.dep_map, 0, 0, _RET_IP_); + rpc_clnt_sigmask(clnt, &oldset); res = wait_on_bit(&clp->cl_state, NFS4CLNT_STATE_RECOVER, nfs4_wait_bit_interruptible, TASK_INTERRUPTIBLE); rpc_clnt_sigunmask(clnt, &oldset); + + rwsem_release(&clp->cl_sem.dep_map, 1, _RET_IP_); return res; }