IB/srpt: Fix login-related race conditions
authorBart Van Assche <bart.vanassche@wdc.com>
Wed, 17 Jan 2018 00:14:13 +0000 (16:14 -0800)
committerDoug Ledford <dledford@redhat.com>
Thu, 18 Jan 2018 19:49:26 +0000 (14:49 -0500)
commitdb7683d7deb25d6edc9c59ac45c56c6a48a45514
treeb8bbb696c626492fd0e643ceee233a183fae71f9
parent63d370a6a929b17859c140d58cb54ce36d0c4f04
IB/srpt: Fix login-related race conditions

Make sure that sport->mutex is not released between the duplicate
channel check, adding a channel to the channel list and performing
the sport enabled check. Avoid that srpt_disconnect_ch() can be
invoked concurrently with the ib_send_cm_rep() call by
srpt_cm_req_recv().

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/srpt/ib_srpt.c