[PATCH 0/2] Fix the assert failure in scsi_dma_complete

Li Qiang posted 2 patches 3 years, 8 months ago
Test docker-quick@centos7 passed
Test docker-mingw@fedora passed
Test checkpatch passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200815141940.44025-1-liq3ea@163.com
Maintainers: Fam Zheng <fam@euphon.net>, Paolo Bonzini <pbonzini@redhat.com>, Hannes Reinecke <hare@suse.com>
hw/scsi/megasas.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[PATCH 0/2] Fix the assert failure in scsi_dma_complete
Posted by Li Qiang 3 years, 8 months ago
Currently in 'megasas_map_sgl' when 'iov_count=0' will just return
success however the 'cmd' doens't contain any iov. This will cause
the assert in 'scsi_dma_complete' failed. This is because in
'dma_blk_cb' the 'dbs->sg_cur_index == dbs->sg->nsg' will be true
and just call 'dma_complete'. However now there is no aiocb returned.

This is the LP#1878263:

-->https://bugs.launchpad.net/qemu/+bug/1878263

To solve this we will consider the 'iov_count=0' is an error.
In the first patch, I uses -1 to indicate an error and in the second
patch I consider 'iov_count=0' is an error.

Li Qiang (2):
  hw: megasas: return -1 when 'megasas_map_sgl' fails
  hw: megasas: consider 'iov_count=0' is an error in megasas_map_sgl

 hw/scsi/megasas.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.17.1


Re: [PATCH 0/2] Fix the assert failure in scsi_dma_complete
Posted by Paolo Bonzini 3 years, 8 months ago
On 15/08/20 16:19, Li Qiang wrote:
> Currently in 'megasas_map_sgl' when 'iov_count=0' will just return
> success however the 'cmd' doens't contain any iov. This will cause
> the assert in 'scsi_dma_complete' failed. This is because in
> 'dma_blk_cb' the 'dbs->sg_cur_index == dbs->sg->nsg' will be true
> and just call 'dma_complete'. However now there is no aiocb returned.
> 
> This is the LP#1878263:
> 
> -->https://bugs.launchpad.net/qemu/+bug/1878263
> 
> To solve this we will consider the 'iov_count=0' is an error.
> In the first patch, I uses -1 to indicate an error and in the second
> patch I consider 'iov_count=0' is an error.
> 
> Li Qiang (2):
>   hw: megasas: return -1 when 'megasas_map_sgl' fails
>   hw: megasas: consider 'iov_count=0' is an error in megasas_map_sgl
> 
>  hw/scsi/megasas.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 

Queued, thanks.  But do you have a qtest for this?

Paolo


Re: [PATCH 0/2] Fix the assert failure in scsi_dma_complete
Posted by Li Qiang 3 years, 8 months ago
Paolo Bonzini <pbonzini@redhat.com> 于2020年8月18日周二 上午1:05写道:

> On 15/08/20 16:19, Li Qiang wrote:
> > Currently in 'megasas_map_sgl' when 'iov_count=0' will just return
> > success however the 'cmd' doens't contain any iov. This will cause
> > the assert in 'scsi_dma_complete' failed. This is because in
> > 'dma_blk_cb' the 'dbs->sg_cur_index == dbs->sg->nsg' will be true
> > and just call 'dma_complete'. However now there is no aiocb returned.
> >
> > This is the LP#1878263:
> >
> > -->https://bugs.launchpad.net/qemu/+bug/1878263
> >
> > To solve this we will consider the 'iov_count=0' is an error.
> > In the first patch, I uses -1 to indicate an error and in the second
> > patch I consider 'iov_count=0' is an error.
> >
> > Li Qiang (2):
> >   hw: megasas: return -1 when 'megasas_map_sgl' fails
> >   hw: megasas: consider 'iov_count=0' is an error in megasas_map_sgl
> >
> >  hw/scsi/megasas.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
>
> Queued, thanks.  But do you have a qtest for this?
>

Okay, I will cook a qtest for this recently.

Thanks,
Li Qiang


>
> Paolo
>
>