diff mbox series

[PULL,08/12] mirror: Use job_is_cancelled()

Message ID 20210921102017.273679-9-vsementsov@virtuozzo.com (mailing list archive)
State New, archived
Headers show
Series [PULL,01/12] job: Context changes in job_completed_txn_abort() | expand

Commit Message

Vladimir Sementsov-Ogievskiy Sept. 21, 2021, 10:20 a.m. UTC
From: Hanna Reitz <hreitz@redhat.com>

mirror_drained_poll() returns true whenever the job is cancelled,
because "we [can] be sure that it won't issue more requests".  However,
this is only true for force-cancelled jobs, so use job_is_cancelled().

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210907124245.143492-9-hreitz@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block/mirror.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/block/mirror.c b/block/mirror.c
index 6c3d8379f8..cfebe50845 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -1184,7 +1184,7 @@  static bool mirror_drained_poll(BlockJob *job)
      * from one of our own drain sections, to avoid a deadlock waiting for
      * ourselves.
      */
-    if (!s->common.job.paused && !s->common.job.cancelled && !s->in_drain) {
+    if (!s->common.job.paused && !job_is_cancelled(&job->job) && !s->in_drain) {
         return true;
     }