From: Zhang Chen <chen.zhang@intel.com >
To: Xie Changlong <xiechanglong.d@gmail.com>,
Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
qemu-block <qemu-block@nongnu.org>,
qemu-dev <qemu-devel@nongnu.org>
Cc: Zhang Chen <chen.zhang@intel.com>, Zhang Chen <zhangckid@gmail.com>
Subject: [Qemu-devel] [PATCH] block/replication.c: Fix crash issue after failover
Date: Fri, 14 Jun 2019 17:28:53 +0800 [thread overview]
Message-ID: <20190614092853.26551-1-chen.zhang@intel.com> (raw)
From: Zhang Chen <chen.zhang@intel.com>
No block job on active disk after failover.
In the replication_stop() function have canceled the block job,
we check it again here.
Signed-off-by: Zhang Chen <chen.zhang@intel.com>
---
block/replication.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/replication.c b/block/replication.c
index 3d4dedddfc..bdf2bf4bbc 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -146,7 +146,9 @@ static void replication_close(BlockDriverState *bs)
replication_stop(s->rs, false, NULL);
}
if (s->stage == BLOCK_REPLICATION_FAILOVER) {
- job_cancel_sync(&s->active_disk->bs->job->job);
+ if (s->secondary_disk->bs->job) {
+ job_cancel_sync(&s->secondary_disk->bs->job->job);
+ }
}
if (s->mode == REPLICATION_MODE_SECONDARY) {
--
2.17.GIT
next reply other threads:[~2019-06-14 9:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-14 9:28 Zhang Chen [this message]
2019-06-14 10:17 ` [Qemu-devel] [PATCH] block/replication.c: Fix crash issue after failover no-reply
2019-06-14 10:18 ` Kevin Wolf
2019-06-15 19:05 ` Zhang, Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190614092853.26551-1-chen.zhang@intel.com \
--to=chen.zhang@intel.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=xiechanglong.d@gmail.com \
--cc=zhangckid@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).