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 V2 RESEND] block/replication.c: Fix crash issue after failover
Date: Fri, 21 Jun 2019 14:28:43 +0800 [thread overview]
Message-ID: <20190621062843.1605-1-chen.zhang@intel.com> (raw)
From: Zhang Chen <chen.zhang@intel.com>
If we try to close replication after failover, it will crash here.
So we need check the block job on active disk before cancel the job.
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 b41bc507c0..a68bc7e986 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -149,7 +149,9 @@ static void replication_close(BlockDriverState *bs)
replication_stop(s->rs, false, NULL);
}
if (s->stage == BLOCK_REPLICATION_FAILOVER) {
- job_cancel_sync(&s->commit_job->job);
+ if (s->commit_job) {
+ job_cancel_sync(&s->commit_job->job);
+ }
}
if (s->mode == REPLICATION_MODE_SECONDARY) {
--
2.17.GIT
next reply other threads:[~2019-06-21 7:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-21 6:28 Zhang Chen [this message]
2019-06-26 21:41 ` [Qemu-devel] [Qemu-block] [PATCH V2 RESEND] block/replication.c: Fix crash issue after failover John Snow
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=20190621062843.1605-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).