Skip to content

Fix race condition in throttle_group_restart_queue()

Alberto Garcia qemu-devel 3 versions – Applied

Status from this message: Thanks, applied to my block branch:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest1 patch 2 repliesApplied
  2. v21 patch 0 repliesSuperseded
  3. v11 patch 0 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/1throttle-group: Fix race condition in throttle_group_restart_queue()block/throttle-groups.c+60 -191 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/1] Fix race condition in throttle_group_restart_queue()

Hi,

In the previous patch I forgot to relax the assertion for case 2.

If we're restarting the queue when another tgm has a timer armed I don't think we can guarantee that when the timer fires it won't set a new timer on our own tgm before we reach the assertion.

I think that the assertion should depend on reset_timer_armed:

- If it's true, no one else can arm a timer so the assertion holds.
- If it's false, it is possible for the other tgm to arm our timer. The assertion would fail in this case, but I think it's harmless because even if it would fire at the same time the logic in throttle_group_restart_queue_entry() is protected by the lock.

Berto

Alberto Garcia (1):
throttle-group: Fix race condition in throttle_group_restart_queue()

 block/throttle-groups.c | 79 +++++++++++++++++++++++++++++++----------
 1 file changed, 60 insertions(+), 19 deletions(-)
Signature · 1 line
2.47.3