|
|
357786 |
From 7c3744d3960176798cde84b989bab4f7955f97c3 Mon Sep 17 00:00:00 2001
|
|
|
357786 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
357786 |
Date: Tue, 26 Jun 2018 09:47:51 +0200
|
|
|
357786 |
Subject: [PATCH 22/89] blockjob: Fix assertion in block_job_finalize()
|
|
|
357786 |
|
|
|
357786 |
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
357786 |
Message-id: <20180626094856.6924-9-kwolf@redhat.com>
|
|
|
357786 |
Patchwork-id: 81060
|
|
|
357786 |
O-Subject: [RHV-7.6 qemu-kvm-rhev PATCH v2 08/73] blockjob: Fix assertion in block_job_finalize()
|
|
|
357786 |
Bugzilla: 1513543
|
|
|
357786 |
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
|
|
|
357786 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
357786 |
RH-Acked-by: Fam Zheng <famz@redhat.com>
|
|
|
357786 |
|
|
|
357786 |
Every job gets a non-NULL job->txn on creation, but it doesn't
|
|
|
357786 |
necessarily keep it until it is decommissioned: Finalising a job removes
|
|
|
357786 |
it from its transaction. Therefore, calling 'blockdev-job-finalize' a
|
|
|
357786 |
second time on an already concluded job causes an assertion failure.
|
|
|
357786 |
|
|
|
357786 |
Remove job->txn from the assertion in block_job_finalize() to fix this.
|
|
|
357786 |
block_job_do_finalize() still has the same assertion, but if a job is
|
|
|
357786 |
already removed from its transaction, block_job_apply_verb() will
|
|
|
357786 |
already error out before we run into that assertion.
|
|
|
357786 |
|
|
|
357786 |
Cc: qemu-stable@nongnu.org
|
|
|
357786 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
357786 |
Reviewed-by: Eric Blake <eblake@redhat.com>
|
|
|
357786 |
Reviewed-by: Max Reitz <mreitz@redhat.com>
|
|
|
357786 |
Reviewed-by: John Snow <jsnow@redhat.com>
|
|
|
357786 |
(cherry picked from commit 37aa19b63c46d933f1e4ea944cfccee54e2caf4a)
|
|
|
357786 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
357786 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
357786 |
---
|
|
|
357786 |
blockjob.c | 2 +-
|
|
|
357786 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
357786 |
|
|
|
357786 |
diff --git a/blockjob.c b/blockjob.c
|
|
|
357786 |
index 6746cad..0033b96 100644
|
|
|
357786 |
--- a/blockjob.c
|
|
|
357786 |
+++ b/blockjob.c
|
|
|
357786 |
@@ -710,7 +710,7 @@ void block_job_complete(BlockJob *job, Error **errp)
|
|
|
357786 |
|
|
|
357786 |
void block_job_finalize(BlockJob *job, Error **errp)
|
|
|
357786 |
{
|
|
|
357786 |
- assert(job && job->id && job->txn);
|
|
|
357786 |
+ assert(job && job->id);
|
|
|
357786 |
if (block_job_apply_verb(job, BLOCK_JOB_VERB_FINALIZE, errp)) {
|
|
|
357786 |
return;
|
|
|
357786 |
}
|
|
|
357786 |
--
|
|
|
357786 |
1.8.3.1
|
|
|
357786 |
|