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 <[email protected]>; Kevin Wolf
> <[email protected]>; Max Reitz <[email protected]>; qemu-block <qemu-
> [email protected]>; qemu-dev <[email protected]>
> Cc: Zhang Chen <[email protected]>; Zhang, Chen <[email protected]>
> Subject: [PATCH V2] block/replication.c: Fix crash issue after failover
> 
> From: Zhang Chen <[email protected]>
> 
> 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 <[email protected]>
> ---
>  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


Reply via email to