[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 3/7] backup: don't acquire aio_context in backup_clean
From: |
Kevin Wolf |
Subject: |
[PULL 3/7] backup: don't acquire aio_context in backup_clean |
Date: |
Tue, 7 Apr 2020 16:26:12 +0200 |
From: Stefan Reiter <address@hidden>
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>
Reviewed-by: Max Reitz <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Kevin Wolf <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.20.1
- [PULL 0/7] Block layer patches, Kevin Wolf, 2020/04/07
- [PULL 1/7] job: take each job's lock individually in job_txn_apply, Kevin Wolf, 2020/04/07
- [PULL 4/7] block-backend: Reorder flush/pdiscard function definitions, Kevin Wolf, 2020/04/07
- [PULL 5/7] block: Increase BB.in_flight for coroutine and sync interfaces, Kevin Wolf, 2020/04/07
- [PULL 6/7] block: Fix blk->in_flight during blk_wait_while_drained(), Kevin Wolf, 2020/04/07
- [PULL 7/7] vpc: Don't round up already aligned BAT sizes, Kevin Wolf, 2020/04/07
- [PULL 3/7] backup: don't acquire aio_context in backup_clean,
Kevin Wolf <=
- [PULL 2/7] replication: assert we own context before job_cancel_sync, Kevin Wolf, 2020/04/07
- Re: [PULL 0/7] Block layer patches, Peter Maydell, 2020/04/07