IB/cm: Avoid AV ah_attr overwriting during LAP message handling
authorParav Pandit <parav@mellanox.com>
Mon, 14 May 2018 08:11:07 +0000 (11:11 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 16 May 2018 20:11:46 +0000 (14:11 -0600)
commita5c57d327272bdf3a8b19686eaca2ec683449e67
tree1d64b3c5249c514fbb0596ea47660cd255a730c2
parentf43c00c04bbf01be0822ef9f0281cc69b56c4e40
IB/cm: Avoid AV ah_attr overwriting during LAP message handling

AH attribute of the cm_id can be overwritten if LAP message is received
on CM request which is in progress. This bug got introduced to avoid
sleeping when spin lock is held as part of commit in Fixes tag.

Therefore validate the cm_id state first and continue to perform AV
ah_attr initialization.

Given that Aleternative path related messages are not supported for
RoCE, init_av_from_response/path is such messages are ok to be called
from blocking context.

Fixes: 33f93e1ebcf5 ("IB/cm: Fix sleeping while spin lock is held")
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/cm.c