Drivers: hv: vmbus: Fix a race condition in "_show" functions
Status from this message: Queued up, thanks Kimberly!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest3 patches 10 repliesApplied
- v22 patches 3 repliesSuperseded
Changes in v3 from the cover letter
Patch 1: Drivers: hv: vmbus: Refactor chan->state if statement
- Added the “reviewed-by” line from v2.
Patches in v3 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | Drivers: hv: vmbus: Refactor chan->state if statementdrivers/ | +12 | 0 replies | |
| 2/3 | Drivers: hv: vmbus: Set ring_info field to 0 and remove memsetdrivers/ | +1 | 1 reply | |
| 3/3 | Drivers: hv: vmbus: Fix race condition with new ring_buffer_info mutexdrivers/ drivers/ drivers/ +2 more | +79 | 8 replies |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Michael Kelley |
|---|---|
| 1/3 | R-b |
| 2/3 | R-b |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/3] Drivers: hv: vmbus: Fix a race condition in "_show" functions
This patchset fixes a race condition in the "_show" functions that access the channel ring buffers.
Changes in v3:
Patch 1: Drivers: hv: vmbus: Refactor chan->state if statement
- Added the “reviewed-by” line from v2.
Patch 2: Drivers: hv: vmbus: Set ring_info field to 0 and remove memset
- This patch is new. This change allows the new mutex locks in patch 3 to be initialized when the channel is initialized.
Patch 3: Drivers: hv: vmbus: Fix race condition with new
ring_buffer_info mutex
- Added two ring buffer info mutex locks instead of the single channel mutex lock that was proposed in v2.
- Changed the mutex acquire/release calls as needed for the new ring buffer info mutex locks.
- Updated the commit message.
Changes in v2:
- In v1, I proposed using “vmbus_connection.channel_mutex” in the “_show” functions to prevent the race condition. However, using this mutex could result in a deadlock, so a new approach is proposed in this patchset.
- Patch 1 is new and consists of refactoring an if statement.
- Patch 2 introduces a new mutex lock in the “vmbus_channel” struct, which is used to eliminate the race condition.
Kimberly Brown (3):
Drivers: hv: vmbus: Refactor chan->state if statement
Drivers: hv: vmbus: Set ring_info field to 0 and remove memset
Drivers: hv: vmbus: Fix race condition with new ring_buffer_info mutex
drivers/hv/channel_mgmt.c | 2 + drivers/hv/hyperv_vmbus.h | 1 + drivers/hv/ring_buffer.c | 22 ++++++++-- drivers/hv/vmbus_drv.c | 89 +++++++++++++++++++++++++++------------ include/linux/hyperv.h | 7 ++- 5 files changed, 88 insertions(+), 33 deletions(-)
Signature · 1 line
2.17.1