NFSv4: Add lockdep checks to nfs4_wait_clnt_recover()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 13 Dec 2006 21:43:13 +0000 (16:43 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 3 Feb 2007 23:35:08 +0000 (15:35 -0800)
Attempt to detect deadlocks due to caller holding locks on clp->cl_sem

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4proc.c

index 35bfcced2c75d2404ff2eacd3fd8881fbc251bc0..1712d0360ee6fbaf44d98c73fc5634cafab5b45f 100644 (file)
@@ -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;
 }