RDMA/cm: Allow ib_send_cm_rej() to be done under lock
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 10 Mar 2020 09:25:43 +0000 (11:25 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 17 Mar 2020 20:05:54 +0000 (17:05 -0300)
commit81ddb41f876d488416e8aa5a740a4dbd01a83705
treeee578728672aa9c148d190c940042f2271869d3c
parent87cabf3e09fff9960743801a046bb2676427f00a
RDMA/cm: Allow ib_send_cm_rej() to be done under lock

The first thing ib_send_cm_rej() does is obtain the lock, so use the usual
unlocked wrapper, locked actor pattern here.

This avoids a sketchy lock/unlock sequence (which could allow state to
change) during cm_destroy_id().

While here simplify some of the logic in the implementation.

Link: https://lore.kernel.org/r/20200310092545.251365-14-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/cm.c