[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 01/40] scsi-disk: Fix assertion failure on WRITE SA
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 01/40] scsi-disk: Fix assertion failure on WRITE SAME |
Date: |
Wed, 21 Oct 2015 12:51:31 -0500 |
From: Fam Zheng <address@hidden>
The last portion of an unaligned WRITE SAME command could fail the
assertion in bdrv_aligned_pwritev:
assert(!qiov || bytes == qiov->size);
Because we updated data->iov.iov_len right above this if block, but
data->qiov still has the old size.
Reinitialize the qiov to make them equal and keep block layer happy.
Cc: address@hidden
Signed-off-by: Fam Zheng <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
(cherry picked from commit a56537a12757a8cdee24ad8c83e5af7a9833ea70)
Signed-off-by: Michael Roth <address@hidden>
---
hw/scsi/scsi-disk.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 64f0694..0e0bc64 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -1683,6 +1683,10 @@ static void scsi_write_same_complete(void *opaque, int
ret)
if (data->iov.iov_len) {
block_acct_start(blk_get_stats(s->qdev.conf.blk), &r->acct,
data->iov.iov_len, BLOCK_ACCT_WRITE);
+ /* blk_aio_write doesn't like the qiov size being different from
+ * nb_sectors, make sure they match.
+ */
+ qemu_iovec_init_external(&data->qiov, &data->iov, 1);
r->req.aiocb = blk_aio_writev(s->qdev.conf.blk, data->sector,
&data->qiov, data->iov.iov_len / 512,
scsi_write_same_complete, data);
--
1.9.1
- [Qemu-stable] [PATCH 00/40] Patch Round-up for stable 2.4.1, freeze on 2015-10-29, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 11/40] PPC: E500: Update u-boot to commit 79c884d7e4, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 12/40] s390x/css: start with cleared cstat/dstat, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 13/40] rtl8139: Fix receive buffer overflow check, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 15/40] cpus.c: qemu_mutex_lock_iothread fix race condition at cpu thread init, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 14/40] rtl8139: Do not consume the packet during overflow in standard mode., Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 17/40] target-arm: Share all common TCG temporaries, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 16/40] virtio dataplane: adapt dataplane for virtio Version 1, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 18/40] qcow2: Make size_to_clusters() return uint64_t, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 01/40] scsi-disk: Fix assertion failure on WRITE SAME,
Michael Roth <=
- [Qemu-stable] [PATCH 23/40] slirp: Fix non blocking connect for w32, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 24/40] ide: unify io_buffer_offset increments, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 22/40] nbd: release exp->blk after all clients are closed, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 19/40] ide: fix ATAPI command permissions, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 20/40] gtk: use setlocale() for LC_MESSAGES only, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 21/40] spapr_pci: fix device tree props for MSI/MSI-X, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 25/40] qom: Do not reuse errp after a possible error, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 26/40] qom: Fix invalid error check in property_get_str(), Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 27/40] tcg/mips: Fix clobbering of qemu_ld inputs, Michael Roth, 2015/10/21
- [Qemu-stable] [PATCH 28/40] target-ppc: fix vcipher, vcipherlast, vncipherlast and vpermxor, Michael Roth, 2015/10/21