Commit b9ef520f authored by Sean Hefty's avatar Sean Hefty Committed by Roland Dreier

[PATCH] IB: fix userspace CM deadlock

Fix deadlock condition resulting from trying to destroy a cm_id
from the context of a CM thread.  The synchronization around the
ucm context structure is simplified as a result, and some simple
code cleanup is included.
Signed-off-by: default avatarSean Hefty <sean.hefty@intel.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 4ce05937
This diff is collapsed.
...@@ -48,9 +48,7 @@ ...@@ -48,9 +48,7 @@
struct ib_ucm_file { struct ib_ucm_file {
struct semaphore mutex; struct semaphore mutex;
struct file *filp; struct file *filp;
/*
* list of pending events
*/
struct list_head ctxs; /* list of active connections */ struct list_head ctxs; /* list of active connections */
struct list_head events; /* list of pending events */ struct list_head events; /* list of pending events */
wait_queue_head_t poll_wait; wait_queue_head_t poll_wait;
...@@ -58,12 +56,11 @@ struct ib_ucm_file { ...@@ -58,12 +56,11 @@ struct ib_ucm_file {
struct ib_ucm_context { struct ib_ucm_context {
int id; int id;
int ref; wait_queue_head_t wait;
int error; atomic_t ref;
struct ib_ucm_file *file; struct ib_ucm_file *file;
struct ib_cm_id *cm_id; struct ib_cm_id *cm_id;
struct semaphore mutex;
struct list_head events; /* list of pending events. */ struct list_head events; /* list of pending events. */
struct list_head file_list; /* member in file ctx list */ struct list_head file_list; /* member in file ctx list */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment