浏览代码

[infiniband] Avoid multiple calls to ib_cmrc_shutdown()

When a CMRC connection is closed, the deferred shutdown process calls
ib_destroy_qp().  This will cause the receive work queue entries to
complete in error (since they are being cancelled), which will in turn
reschedule the deferred shutdown process.  This eventually leads to
ib_destroy_conn() being called on a connection that has already been
freed.

Fix by explicitly cancelling any pending shutdown process after the
shutdown process has completed.

Ironically, this almost exactly reverts commit 019d4c1 ("[infiniband]
Use a one-shot process for CMRC shutdown"); prior to the introduction
of one-shot processes the only way to achieve a one-shot process was
for the process to cancel itself.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 年前
父节点
当前提交
7544763626
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3
    0
      src/net/infiniband/ib_cmrc.c

+ 3
- 0
src/net/infiniband/ib_cmrc.c 查看文件

117
 	ib_destroy_cq ( cmrc->ibdev, cmrc->cq );
117
 	ib_destroy_cq ( cmrc->ibdev, cmrc->cq );
118
 	ib_close ( cmrc->ibdev );
118
 	ib_close ( cmrc->ibdev );
119
 
119
 
120
+	/* Cancel any pending shutdown */
121
+	process_del ( &cmrc->shutdown );
122
+
120
 	/* Drop the remaining reference */
123
 	/* Drop the remaining reference */
121
 	ref_put ( &cmrc->refcnt );
124
 	ref_put ( &cmrc->refcnt );
122
 }
125
 }

正在加载...
取消
保存