[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/10] mirror: Do not enter a paused job on completion
From: |
Kevin Wolf |
Subject: |
[PULL 08/10] mirror: Do not enter a paused job on completion |
Date: |
Fri, 9 Apr 2021 18:15:46 +0200 |
From: Max Reitz <mreitz@redhat.com>
Currently, it is impossible to complete jobs on standby (i.e. paused
ready jobs), but actually the only thing in mirror_complete() that does
not work quite well with a paused job is the job_enter() at the end.
If we make it conditional, this function works just fine even if the
mirror job is paused.
So technically this is a no-op, but obviously the intention is to accept
block-job-complete even for jobs on standby, which we need this patch
for first.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20210409120422.144040-3-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/mirror.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/block/mirror.c b/block/mirror.c
index f1f936bf1a..5a71bd8bbc 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -1148,7 +1148,11 @@ static void mirror_complete(Job *job, Error **errp)
}
s->should_complete = true;
- job_enter(job);
+
+ /* If the job is paused, it will be re-entered when it is resumed */
+ if (!job->paused) {
+ job_enter(job);
+ }
}
static void coroutine_fn mirror_pause(Job *job)
--
2.30.2
- [PULL 00/10] Block layer fixes for 6.0-rc3, Kevin Wolf, 2021/04/09
- [PULL 01/10] block/rbd: fix memory leak in qemu_rbd_connect(), Kevin Wolf, 2021/04/09
- [PULL 02/10] block/rbd: fix memory leak in qemu_rbd_co_create_opts(), Kevin Wolf, 2021/04/09
- [PULL 04/10] iotests: add test for removing persistent bitmap from backing file, Kevin Wolf, 2021/04/09
- [PULL 06/10] hw/block/fdc: Fix 'fallback' property on sysbus floppy disk controllers, Kevin Wolf, 2021/04/09
- [PULL 03/10] iotests/qsd-jobs: Filter events in the first test, Kevin Wolf, 2021/04/09
- [PULL 05/10] iotests: Test mirror-top filter permissions, Kevin Wolf, 2021/04/09
- [PULL 08/10] mirror: Do not enter a paused job on completion,
Kevin Wolf <=
- [PULL 09/10] job: Allow complete for jobs on standby, Kevin Wolf, 2021/04/09
- [PULL 10/10] test-blockjob: Test job_wait_unpaused(), Kevin Wolf, 2021/04/09
- [PULL 07/10] mirror: Move open_backing_file to exit_common, Kevin Wolf, 2021/04/09
- Re: [PULL 00/10] Block layer fixes for 6.0-rc3, Peter Maydell, 2021/04/10