summaryrefslogtreecommitdiff
path: root/block/blk-mq.h
diff options
context:
space:
mode:
authorHåkon Bugge <haakon.bugge@oracle.com>2021-06-22 15:39:57 +0200
committerJason Gunthorpe <jgg@nvidia.com>2021-06-24 15:29:53 -0300
commitca0c448d2b9f43e3175835d536853854ef544e22 (patch)
treebb0ae9c2a205174f29c7d968e1cfe32aca84b924 /block/blk-mq.h
parentdc70f7c3ed34b081c02a611591c5079c53b771b8 (diff)
RDMA/cma: Protect RMW with qp_mutex
The struct rdma_id_private contains three bit-fields, tos_set, timeout_set, and min_rnr_timer_set. These are set by accessor functions without any synchronization. If two or all accessor functions are invoked in close proximity in time, there will be Read-Modify-Write from several contexts to the same variable, and the result will be intermittent. Fixed by protecting the bit-fields by the qp_mutex in the accessor functions. The consumer of timeout_set and min_rnr_timer_set is in rdma_init_qp_attr(), which is called with qp_mutex held for connected QPs. Explicit locking is added for the consumers of tos and tos_set. This commit depends on ("RDMA/cma: Remove unnecessary INIT->INIT transition"), since the call to rdma_init_qp_attr() from cma_init_conn_qp() does not hold the qp_mutex. Fixes: 2c1619edef61 ("IB/cma: Define option to set ack timeout and pack tos_set") Fixes: 3aeffc46afde ("IB/cma: Introduce rdma_set_min_rnr_timer()") Link: https://lore.kernel.org/r/1624369197-24578-3-git-send-email-haakon.bugge@oracle.com Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'block/blk-mq.h')
0 files changed, 0 insertions, 0 deletions