[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 1/3] backup: don't acquire aio_context in backup_clean
From: |
Stefan Reiter |
Subject: |
[PATCH v2 1/3] backup: don't acquire aio_context in backup_clean |
Date: |
Thu, 26 Mar 2020 16:56:26 +0100 |
All code-paths leading to backup_clean (via job_clean) have the job's
context already acquired. The job's context is guaranteed to be the same
as the one used by backup_top via backup_job_create.
Since the previous logic effectively acquired the lock twice, this
broke cleanup of backups for disks using IO threads, since the BDRV_POLL_WHILE
in bdrv_backup_top_drop -> bdrv_do_drained_begin would only release the lock
once, thus deadlocking with the IO thread.
This is a partial revert of 0abf2581717a19.
Signed-off-by: Stefan Reiter <address@hidden>
---
block/backup.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/block/backup.c b/block/backup.c
index 7430ca5883..a7a7dcaf4c 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -126,11 +126,7 @@ static void backup_abort(Job *job)
static void backup_clean(Job *job)
{
BackupBlockJob *s = container_of(job, BackupBlockJob, common.job);
- AioContext *aio_context = bdrv_get_aio_context(s->backup_top);
-
- aio_context_acquire(aio_context);
bdrv_backup_top_drop(s->backup_top);
- aio_context_release(aio_context);
}
void backup_do_checkpoint(BlockJob *job, Error **errp)
--
2.26.0
- [PATCH v2 0/3] Fix some AIO context locking in jobs, Stefan Reiter, 2020/03/26
- [PATCH v2 3/3] replication: acquire aio context before calling job_cancel_sync, Stefan Reiter, 2020/03/26
- [PATCH v2 1/3] backup: don't acquire aio_context in backup_clean,
Stefan Reiter <=
- [PATCH v2 2/3] job: take each job's lock individually in job_txn_apply, 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