]> git.proxmox.com Git - mirror_qemu.git/commit
util/interval-tree: Use qatomic_set_mb in rb_link_node
authorRichard Henderson <richard.henderson@linaro.org>
Sat, 22 Jul 2023 14:25:30 +0000 (15:25 +0100)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 31 Jul 2023 19:19:13 +0000 (12:19 -0700)
commit4c8baa02d36379507afd17bdea87aabe0aa32ed3
treea398aa791a4ac7a35743d08baedd2353ee1fb6b8
parent055b86e0f0b4325117055d8d31c49011258f4af3
util/interval-tree: Use qatomic_set_mb in rb_link_node

Ensure that the stores to rb_left and rb_right are complete before
inserting the new node into the tree.  Otherwise a concurrent reader
could see garbage in the new leaf.

Cc: qemu-stable@nongnu.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
util/interval-tree.c