qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, famz@redhat.com
Subject: Re: [Qemu-devel] [PATCH 2/2] scsi-disk: fix rerror/werror=ignore
Date: Sun, 18 Nov 2018 15:26:00 +0000	[thread overview]
Message-ID: <20181118152600.GA6861@redhat.com> (raw)
In-Reply-To: <1539424403-2884-3-git-send-email-pbonzini@redhat.com>

On Sat, Oct 13, 2018 at 11:53:23AM +0200, Paolo Bonzini wrote:
> rerror=ignore was returning true from scsi_handle_rw_error but the callers were not
> calling scsi_req_complete when rerror=ignore returns true (this is the correct thing
> to do when true is returned after executing a passthrough command).  Fix this by
> calling it in scsi_handle_rw_error.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/scsi/scsi-disk.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index 4074d7c..e2c5408 100644
> --- a/hw/scsi/scsi-disk.c
> +++ b/hw/scsi/scsi-disk.c
> @@ -473,10 +473,15 @@ static bool scsi_handle_rw_error(SCSIDiskReq *r, int error, bool acct_failed)
>      }
>  
>      blk_error_action(s->qdev.conf.blk, action, is_read, error);
> +    if (action == BLOCK_ERROR_ACTION_IGNORE) {
> +        scsi_req_complete(&r->req, 0);
> +        return true;
> +    }
> +
>      if (action == BLOCK_ERROR_ACTION_STOP) {
>          scsi_req_retry(&r->req);
>      }
> -    return action != BLOCK_ERROR_ACTION_IGNORE;
> +    return false;
>  }

This commit seems to cause an assertion failure in qemu which is
trivial to reproduce:

(1) Create an NBD disk which returns EIO for every request:

  $ nbdkit -f -v --filter=error memory size=64M error-rate=100%

(2) Attach the disk to qemu as a virtio-scsi device:

  $ x86_64-softmmu/qemu-system-x86_64 -device virtio-scsi,id=scsi -drive file=nbd:localhost:10809,format=raw,id=hd0,if=none -device scsi-hd,drive=hd0
  qemu-system-x86_64: hw/scsi/scsi-bus.c:1374: scsi_req_complete: Assertion `req->status == -1' failed.

More details including a stack trace here:

  https://bugzilla.redhat.com/show_bug.cgi?id=1650975

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html

      reply	other threads:[~2018-11-18 15:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-13  9:53 [Qemu-devel] [PATCH 0/2] scsi-disk: fix bugs in rerror/werror Paolo Bonzini
2018-10-13  9:53 ` [Qemu-devel] [PATCH 1/2] scsi-disk: fix double completion of failing passthrough requests Paolo Bonzini
2018-10-13  9:53 ` [Qemu-devel] [PATCH 2/2] scsi-disk: fix rerror/werror=ignore Paolo Bonzini
2018-11-18 15:26   ` Richard W.M. Jones [this message]

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=20181118152600.GA6861@redhat.com \
    --to=rjones@redhat.com \
    --cc=famz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).