[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 09/13] mirror: Use job_is_cancelled()
From: |
Hanna Reitz |
Subject: |
[PATCH v5 09/13] mirror: Use job_is_cancelled() |
Date: |
Wed, 6 Oct 2021 17:19:36 +0200 |
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>
---
block/mirror.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/mirror.c b/block/mirror.c
index 2d9642cb00..0eaba88060 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;
}
--
2.31.1
- [PATCH v5 00/13] mirror: Handle errors after READY cancel, Hanna Reitz, 2021/10/06
- [PATCH v5 01/13] job: Context changes in job_completed_txn_abort(), Hanna Reitz, 2021/10/06
- [PATCH v5 02/13] mirror: Keep s->synced on error, Hanna Reitz, 2021/10/06
- [PATCH v5 03/13] mirror: Drop s->synced, Hanna Reitz, 2021/10/06
- [PATCH v5 04/13] job: Force-cancel jobs in a failed transaction, Hanna Reitz, 2021/10/06
- [PATCH v5 05/13] job: @force parameter for job_cancel_sync(), Hanna Reitz, 2021/10/06
- [PATCH v5 09/13] mirror: Use job_is_cancelled(),
Hanna Reitz <=
- [PATCH v5 07/13] job: Do not soft-cancel after a job is done, Hanna Reitz, 2021/10/06
- [PATCH v5 06/13] jobs: Give Job.force_cancel more meaning, Hanna Reitz, 2021/10/06
- [PATCH v5 08/13] job: Add job_cancel_requested(), Hanna Reitz, 2021/10/06
- [PATCH v5 12/13] mirror: Do not clear .cancelled, Hanna Reitz, 2021/10/06
- [PATCH v5 11/13] mirror: Stop active mirroring after force-cancel, Hanna Reitz, 2021/10/06
- [PATCH v5 13/13] iotests: Add mirror-ready-cancel-error test, Hanna Reitz, 2021/10/06