[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-6.2 v3 10/12] mirror: Stop active mirroring after force-cance
From: |
Max Reitz |
Subject: |
[PATCH for-6.2 v3 10/12] mirror: Stop active mirroring after force-cancel |
Date: |
Fri, 6 Aug 2021 11:38:57 +0200 |
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: Max Reitz <mreitz@redhat.com>
---
block/mirror.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block/mirror.c b/block/mirror.c
index bf1d50ff1c..af89c1716a 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -1418,6 +1418,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) {
@@ -1466,6 +1467,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.31.1
- [PATCH for-6.2 v3 06/12] jobs: Give Job.force_cancel more meaning, (continued)
- [PATCH for-6.2 v3 06/12] jobs: Give Job.force_cancel more meaning, Max Reitz, 2021/08/06
- [PATCH for-6.2 v3 05/12] job: @force parameter for job_cancel_sync{, _all}(), Max Reitz, 2021/08/06
- [PATCH for-6.2 v3 07/12] job: Add job_cancel_requested(), Max Reitz, 2021/08/06
- [PATCH for-6.2 v3 08/12] mirror: Use job_is_cancelled(), Max Reitz, 2021/08/06
- [PATCH for-6.2 v3 09/12] mirror: Check job_is_cancelled() earlier, Max Reitz, 2021/08/06
- [PATCH for-6.2 v3 10/12] mirror: Stop active mirroring after force-cancel,
Max Reitz <=
- [PATCH for-6.2 v3 11/12] mirror: Do not clear .cancelled, Max Reitz, 2021/08/06
- [PATCH for-6.2 v3 12/12] iotests: Add mirror-ready-cancel-error test, Max Reitz, 2021/08/06