OSDN Git Service

block: make BlockBackend->disable_request_queuing atomic
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 7 Mar 2023 21:04:26 +0000 (16:04 -0500)
committerKevin Wolf <kwolf@redhat.com>
Tue, 25 Apr 2023 11:15:21 +0000 (13:15 +0200)
commitef80ec5067d7ca5b46e5b88be1be33cddfd33551
treee34b78dcb1dbdad2cdf7618ab3ac03670d838128
parentc4d5bf99b7fccf8849316b9f5100525b1beb8237
block: make BlockBackend->disable_request_queuing atomic

This field is accessed by multiple threads without a lock. Use explicit
qatomic_read()/qatomic_set() calls. There is no need for acquire/release
because blk_set_disable_request_queuing() doesn't provide any
guarantees (it helps that it's used at BlockBackend creation time and
not when there is I/O in flight).

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Message-Id: <20230307210427.269214-3-stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/block-backend.c