* [Qemu-devel] [PATCH V2] block/replication.c: Fix crash issue after failover
@ 2019-06-21 5:52 Zhang Chen
2019-06-21 6:35 ` Zhang, Chen
0 siblings, 1 reply; 2+ messages in thread
From: Zhang Chen @ 2019-06-21 5:52 UTC (permalink / raw)
To: Xie Changlong, Kevin Wolf, Max Reitz, qemu-block, qemu-dev
Cc: Zhang Chen, Zhang Chen
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 3d4dedddfc..845f796dd4 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->active_disk->bs->job) {
+ job_cancel_sync(&s->active_disk->bs->job->job);
+ }
}
if (s->mode == REPLICATION_MODE_SECONDARY) {
--
2.17.GIT
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH V2] block/replication.c: Fix crash issue after failover
2019-06-21 5:52 [Qemu-devel] [PATCH V2] block/replication.c: Fix crash issue after failover Zhang Chen
@ 2019-06-21 6:35 ` Zhang, Chen
0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Chen @ 2019-06-21 6:35 UTC (permalink / raw)
To: Xie Changlong, Kevin Wolf, Max Reitz, qemu-block, qemu-dev; +Cc: Zhang Chen
Please redirect to the V2 RESEND patch, this one not rebased on upstream code.
Thanks
Zhang Chen
> -----Original Message-----
> From: Zhang, Chen
> Sent: Friday, June 21, 2019 1:52 PM
> 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 <zhangckid@gmail.com>; Zhang, Chen <chen.zhang@intel.com>
> Subject: [PATCH V2] block/replication.c: Fix crash issue after failover
>
> 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
> 3d4dedddfc..845f796dd4 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->active_disk->bs->job) {
> + job_cancel_sync(&s->active_disk->bs->job->job);
> + }
> }
>
> if (s->mode == REPLICATION_MODE_SECONDARY) {
> --
> 2.17.GIT
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-21 6:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-21 5:52 [Qemu-devel] [PATCH V2] block/replication.c: Fix crash issue after failover Zhang Chen
2019-06-21 6:35 ` Zhang, Chen
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).