qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] scsi-disk: fix rerror/werror=ignore


From: Richard W.M. Jones
Subject: Re: [Qemu-devel] [PATCH 2/2] scsi-disk: fix rerror/werror=ignore
Date: Sun, 18 Nov 2018 15:26:00 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

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 <address@hidden>
> ---
>  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 via email to

[Prev in Thread] Current Thread [Next in Thread]