All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	lvivier@redhat.com, qemu-block@nongnu.org, pl@kamp.de,
	qemu-stable@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	dgibson@redhat.com
Subject: Re: [Qemu-devel] [PATCH] virtio-blk: Move resetting of req->mr_next to virtio_blk_handle_rw_error
Date: Mon, 23 Nov 2015 15:41:56 +0100	[thread overview]
Message-ID: <565325B4.6040103@redhat.com> (raw)
In-Reply-To: <1448239280-15025-1-git-send-email-famz@redhat.com>



On 23/11/2015 01:41, Fam Zheng wrote:
> "werror=report" would free the req in virtio_blk_handle_rw_error, we
> mustn't write to it in that case.
> 
> Reported-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  hw/block/virtio-blk.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
> index 848f3fe..756ae5c 100644
> --- a/hw/block/virtio-blk.c
> +++ b/hw/block/virtio-blk.c
> @@ -72,6 +72,9 @@ static int virtio_blk_handle_rw_error(VirtIOBlockReq *req, int error,
>      VirtIOBlock *s = req->dev;
>  
>      if (action == BLOCK_ERROR_ACTION_STOP) {
> +        /* Break the link as the next request is going to be parsed from the
> +         * ring again. Otherwise we may end up doing a double completion! */
> +        req->mr_next = NULL;
>          req->next = s->rq;
>          s->rq = req;
>      } else if (action == BLOCK_ERROR_ACTION_REPORT) {
> @@ -112,10 +115,6 @@ static void virtio_blk_rw_complete(void *opaque, int ret)
>               * happen on the other side of the migration).
>               */
>              if (virtio_blk_handle_rw_error(req, -ret, is_read)) {
> -                /* Break the link in case the next request is added to the
> -                 * restart queue and is going to be parsed from the ring again.
> -                 */
> -                req->mr_next = NULL;
>                  continue;
>              }
>          }
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

  reply	other threads:[~2015-11-23 14:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23  0:41 [Qemu-devel] [PATCH] virtio-blk: Move resetting of req->mr_next to virtio_blk_handle_rw_error Fam Zheng
2015-11-23 14:41 ` Paolo Bonzini [this message]
2015-11-24  1:28 ` Stefan Hajnoczi

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=565325B4.6040103@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dgibson@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=stefanha@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.