[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 3/3] replication: acquire aio context before calling job_cance
From: |
Stefan Reiter |
Subject: |
[PATCH v2 3/3] replication: acquire aio context before calling job_cancel_sync |
Date: |
Thu, 26 Mar 2020 16:56:28 +0100 |
job_cancel_sync requires the job's lock to be held, all other callers
already do this (replication_stop, drive_backup_abort,
blockdev_backup_abort, job_cancel_sync_all, cancel_common).
Signed-off-by: Stefan Reiter <address@hidden>
---
block/replication.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/block/replication.c b/block/replication.c
index 413d95407d..6c809cda4e 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -144,12 +144,16 @@ fail:
static void replication_close(BlockDriverState *bs)
{
BDRVReplicationState *s = bs->opaque;
+ Job *commit_job = &s->commit_job->job;
+ AioContext *commit_ctx = commit_job->aio_context;
if (s->stage == BLOCK_REPLICATION_RUNNING) {
replication_stop(s->rs, false, NULL);
}
if (s->stage == BLOCK_REPLICATION_FAILOVER) {
- job_cancel_sync(&s->commit_job->job);
+ aio_context_acquire(commit_ctx);
+ job_cancel_sync(commit_job);
+ aio_context_release(commit_ctx);
}
if (s->mode == REPLICATION_MODE_SECONDARY) {
--
2.26.0
- [PATCH v2 0/3] Fix some AIO context locking in jobs, Stefan Reiter, 2020/03/26
- [PATCH v2 2/3] job: take each job's lock individually in job_txn_apply, Stefan Reiter, 2020/03/26
- [PATCH v2 3/3] replication: acquire aio context before calling job_cancel_sync,
Stefan Reiter <=
- [PATCH v2 1/3] backup: don't acquire aio_context in backup_clean, Stefan Reiter, 2020/03/26
- Re: [PATCH v2 0/3] Fix some AIO context locking in jobs, no-reply, 2020/03/26
- Re: [PATCH v2 0/3] Fix some AIO context locking in jobs, no-reply, 2020/03/26
- Re: [PATCH v2 0/3] Fix some AIO context locking in jobs, Dietmar Maurer, 2020/03/27
- Re: [PATCH v2 0/3] Fix some AIO context locking in jobs, Dietmar Maurer, 2020/03/27