]> git.baikalelectronics.ru Git - kernel.git/commit
Drivers: hv: vmbus: Use channel_mutex in channel_vp_mapping_show()
authorAndrea Parri (Microsoft) <parri.andrea@gmail.com>
Wed, 17 Jun 2020 16:46:39 +0000 (18:46 +0200)
committerWei Liu <wei.liu@kernel.org>
Fri, 19 Jun 2020 15:38:26 +0000 (15:38 +0000)
commita2a89521895c4311cc9db34398d81531bac3a502
tree0ae6c8ec7eb477178ed0c43f5ecf26a8046f4a0a
parentda4d7f40aa1d8860c05b00225b2cb011d5816ebe
Drivers: hv: vmbus: Use channel_mutex in channel_vp_mapping_show()

The primitive currently uses channel->lock to protect the loop over
sc_list w.r.t. list additions/deletions but it doesn't protect the
target_cpu(s) loads w.r.t. a concurrent target_cpu_store(): while the
data races on target_cpu are hardly of any concern here, replace the
channel->lock critical section with a channel_mutex critical section
and extend the latter to include the loads of target_cpu; this same
pattern is also used in hv_synic_cleanup().

Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
Link: https://lore.kernel.org/r/20200617164642.37393-6-parri.andrea@gmail.com
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/vmbus_drv.c