From: Chuck Lever Date: Wed, 28 May 2014 14:34:07 +0000 (-0400) Subject: xprtrdma: Ensure ia->ri_id->qp is not NULL when reconnecting X-Git-Tag: omap-for-v3.16/fixes-against-rc1~64^2~5^2~8 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec62f40d3505a643497d105c297093bb90afd44e;p=pandora-kernel.git xprtrdma: Ensure ia->ri_id->qp is not NULL when reconnecting Devesh Sharma reports that after a disconnect, his HCA is failing to create a fresh QP, leaving ia_ri->ri_id->qp set to NULL. But xprtrdma still allows RPCs to wake up and post LOCAL_INV as they exit, causing an oops. rpcrdma_ep_connect() is allowing the wake-up by leaking the QP creation error code (-EPERM in this case) to the RPC client's generic layer. xprt_connect_status() does not recognize -EPERM, so it kills pending RPC tasks immediately rather than retrying the connect. Re-arrange the QP creation logic so that when it fails on reconnect, it leaves ->qp with the old QP rather than NULL. If pending RPC tasks wake and exit, LOCAL_INV work requests will flush rather than oops. On initial connect, leaving ->qp == NULL is OK, since there are no pending RPCs that might use ->qp. But be sure not to try to destroy a NULL QP when rpcrdma_ep_connect() is retried. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker --- Reading git-diff-tree failed