aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>2023-02-03 16:21:53 +0100
committerKevin Wolf <kwolf@redhat.com>2023-02-23 19:49:20 +0100
commit742bf09b2004a78708f64327d61471fe011ff799 (patch)
tree46fd44f8da6d2e5151e3cf8d158909a4c33f4de1 /qemu-img.c
parenteeb4777544e41106c85146a96e16da14ab13110f (diff)
block: Mark bdrv_co_copy_range() GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_co_copy_range() need to hold a reader lock for the graph. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20230203152202.49054-15-kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/qemu-img.c b/qemu-img.c
index cd0178b51b..9aeac69fa6 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2041,7 +2041,9 @@ retry:
if (s->ret == -EINPROGRESS) {
if (copy_range) {
- ret = convert_co_copy_range(s, sector_num, n);
+ WITH_GRAPH_RDLOCK_GUARD() {
+ ret = convert_co_copy_range(s, sector_num, n);
+ }
if (ret) {
s->copy_range = false;
goto retry;