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>
This commit is contained in:
Emanuele Giuseppe Esposito 2023-02-03 16:21:53 +01:00 committed by Kevin Wolf
parent eeb4777544
commit 742bf09b20
10 changed files with 66 additions and 77 deletions

View file

@ -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;