[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/12] mirror: Stop active mirroring after force-cancel
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PULL 10/12] mirror: Stop active mirroring after force-cancel |
Date: |
Tue, 21 Sep 2021 13:20:15 +0300 |
From: Hanna Reitz <hreitz@redhat.com>
Once the mirror job is force-cancelled (job_is_cancelled() is true), we
should not generate new I/O requests. This applies to active mirroring,
too, so stop it once the job is cancelled.
(We must still forward all I/O requests to the source, though, of
course, but those are not really I/O requests generated by the job, so
this is fine.)
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-11-hreitz@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
block/mirror.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block/mirror.c b/block/mirror.c
index 1dbf648311..bbf5815fd7 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -1425,6 +1425,7 @@ static int coroutine_fn
bdrv_mirror_top_do_write(BlockDriverState *bs,
bool copy_to_target;
copy_to_target = s->job->ret >= 0 &&
+ !job_is_cancelled(&s->job->common.job) &&
s->job->copy_mode == MIRROR_COPY_MODE_WRITE_BLOCKING;
if (copy_to_target) {
@@ -1473,6 +1474,7 @@ static int coroutine_fn
bdrv_mirror_top_pwritev(BlockDriverState *bs,
bool copy_to_target;
copy_to_target = s->job->ret >= 0 &&
+ !job_is_cancelled(&s->job->common.job) &&
s->job->copy_mode == MIRROR_COPY_MODE_WRITE_BLOCKING;
if (copy_to_target) {
--
2.29.2
- [PULL 00/12] jobs: mirror: Handle errors after READY cancel, Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 04/12] job: Force-cancel jobs in a failed transaction, Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 01/12] job: Context changes in job_completed_txn_abort(), Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 05/12] job: @force parameter for job_cancel_sync(), Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 02/12] mirror: Keep s->synced on error, Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 06/12] jobs: Give Job.force_cancel more meaning, Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 07/12] job: Add job_cancel_requested(), Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 09/12] mirror: Check job_is_cancelled() earlier, Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 08/12] mirror: Use job_is_cancelled(), Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 03/12] mirror: Drop s->synced, Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 10/12] mirror: Stop active mirroring after force-cancel,
Vladimir Sementsov-Ogievskiy <=
- [PULL 11/12] mirror: Do not clear .cancelled, Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 12/12] iotests: Add mirror-ready-cancel-error test, Vladimir Sementsov-Ogievskiy, 2021/09/21
- Re: [PULL 00/12] jobs: mirror: Handle errors after READY cancel, Richard Henderson, 2021/09/22